diff --git a/lib/pages/interval_page.dart b/lib/pages/interval_page.dart index 26bf35b..8239d09 100644 --- a/lib/pages/interval_page.dart +++ b/lib/pages/interval_page.dart @@ -59,9 +59,9 @@ class _IntervalTimerPageState extends State { 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(); @@ -85,8 +85,9 @@ class _IntervalTimerPageState extends State { } Future _playWorkoutMusic() async { - await warmUpPlayer.dispose(); + await warmUpPlayer.stop(); Future.delayed(const Duration(microseconds: 600)).then((value) async { + await workoutPlayer.setReleaseMode(ReleaseMode.loop); await workoutPlayer.play(UrlSource('assets/workout.mp3')); }); } @@ -121,7 +122,8 @@ class _IntervalTimerPageState extends State { _currentBlock++; _currentDuration = _cooldownDuration; () async { - await workoutPlayer.dispose(); + await workoutPlayer.stop(); + await coolDownPlayer.setReleaseMode(ReleaseMode.loop); await coolDownPlayer.play(UrlSource('assets/cool_down.mp3')); }(); } else {