enable timer to replay music
parent
4700f52646
commit
37b941cdd1
|
@ -60,9 +60,9 @@ class _IntervalTimerPageState extends State<IntervalTimerPage> {
|
|||
|
||||
void _resetTimer() {
|
||||
() async {
|
||||
await coolDownPlayer.dispose();
|
||||
await warmUpPlayer.dispose();
|
||||
await workoutPlayer.dispose();
|
||||
await coolDownPlayer.stop();
|
||||
await warmUpPlayer.stop();
|
||||
await workoutPlayer.stop();
|
||||
}();
|
||||
_isPaused = true;
|
||||
_timer?.cancel();
|
||||
|
@ -87,7 +87,7 @@ class _IntervalTimerPageState extends State<IntervalTimerPage> {
|
|||
}
|
||||
|
||||
Future<void> _playWorkoutMusic() async {
|
||||
await warmUpPlayer.dispose();
|
||||
await warmUpPlayer.stop();
|
||||
Future.delayed(const Duration(microseconds: 600)).then((value) async {
|
||||
await workoutPlayer.play(UrlSource('assets/workout.mp3'));
|
||||
});
|
||||
|
@ -123,7 +123,7 @@ class _IntervalTimerPageState extends State<IntervalTimerPage> {
|
|||
_currentBlock++;
|
||||
_currentDuration = _cooldownDuration;
|
||||
() async {
|
||||
await workoutPlayer.dispose();
|
||||
await workoutPlayer.stop();
|
||||
await coolDownPlayer.play(UrlSource('assets/cool_down.mp3'));
|
||||
}();
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue