diff --git a/example/lib/main.dart b/example/lib/main.dart index 4a9b30ec..6ba02b6a 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -403,8 +403,9 @@ class AudioPlayerTask extends BackgroundAudioTask { } @override - void onStop() { - _audioPlayer.stop(); + Future onStop() async { + await _audioPlayer.stop(); + await _audioPlayer.dispose(); _setState(state: BasicPlaybackState.stopped); _completer.complete(); } diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 5ec5c781..1ac255d2 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -10,7 +10,7 @@ dependencies: sdk: flutter path_provider: ^1.5.1 - just_audio: ^0.1.6 + just_audio: ^0.1.8 flutter_tts: ^0.8.5 rxdart: ^0.24.0 audio_service: