From 878521325e78f62ce0aac08ee3f7a417c9edeabb Mon Sep 17 00:00:00 2001 From: Parricc35 <63447810+Parricc35@users.noreply.github.com> Date: Mon, 20 Feb 2023 11:05:32 +0100 Subject: [PATCH] Changed stop to dispose and removed just_audio --- lib/pages/timer_page.dart | 12 +++++++----- pubspec.lock | 35 ----------------------------------- pubspec.yaml | 1 - 3 files changed, 7 insertions(+), 41 deletions(-) diff --git a/lib/pages/timer_page.dart b/lib/pages/timer_page.dart index b46acf6..85d2876 100644 --- a/lib/pages/timer_page.dart +++ b/lib/pages/timer_page.dart @@ -50,9 +50,11 @@ class _IntervalTimerPageState extends State { } void _resetTimer() { - coolDownPlayer.stop(); - highIntensityPlayer.stop(); - lowIntensityPlayer.stop(); + () async { + await coolDownPlayer.dispose(); + await highIntensityPlayer.dispose(); + await lowIntensityPlayer.dispose(); + }(); _isPaused = true; _timer?.cancel(); _currentBlock = 0; @@ -67,7 +69,7 @@ class _IntervalTimerPageState extends State { } Future _playLowIntensityMusic() async { - await highIntensityPlayer.stop(); + await highIntensityPlayer.dispose(); Future.delayed(const Duration(microseconds: 600)).then((value) async { await lowIntensityPlayer.play(UrlSource('assets/workout.mp3')); }); @@ -103,7 +105,7 @@ class _IntervalTimerPageState extends State { _currentBlock++; _currentDuration = _cooldownDuration; () async { - await lowIntensityPlayer.stop(); + await lowIntensityPlayer.dispose(); await coolDownPlayer.play(UrlSource('assets/cool_down.mp3')); }(); } else { diff --git a/pubspec.lock b/pubspec.lock index 3e8e4b8..59da164 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -8,13 +8,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.9.0" - audio_session: - dependency: transitive - description: - name: audio_session - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.13" audioplayers: dependency: "direct main" description: @@ -170,27 +163,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.6.4" - just_audio: - dependency: "direct main" - description: - name: just_audio - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.31" - just_audio_platform_interface: - dependency: transitive - description: - name: just_audio_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "4.2.0" - just_audio_web: - dependency: transitive - description: - name: just_audio_web - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.7" lints: dependency: transitive description: @@ -289,13 +261,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "4.2.4" - rxdart: - dependency: transitive - description: - name: rxdart - url: "https://pub.dartlang.org" - source: hosted - version: "0.27.7" shared_preferences: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 5eb18b2..c25a5a7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -37,7 +37,6 @@ dependencies: cupertino_icons: ^1.0.2 shared_preferences: ^2.0.17 audioplayers: ^3.0.1 - just_audio: ^0.9.31 dev_dependencies: flutter_test: