Created
April 23, 2021 11:00
-
-
Save suragch/2e6d8e712fce2ddf3fdd4ebfb9991933 to your computer and use it in GitHub Desktop.
Steaming audio in Flutter with Just Audio (state)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
class PageManager { | |
final progressNotifier = ValueNotifier<ProgressBarState>( | |
ProgressBarState( | |
current: Duration.zero, | |
buffered: Duration.zero, | |
total: Duration.zero, | |
), | |
); | |
final buttonNotifier = ValueNotifier<ButtonState>(ButtonState.paused); | |
} | |
class ProgressBarState { | |
ProgressBarState({ | |
required this.current, | |
required this.buffered, | |
required this.total, | |
}); | |
final Duration current; | |
final Duration buffered; | |
final Duration total; | |
} | |
enum ButtonState { | |
paused, playing, loading | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment