diff --git a/lib/views/widgets/audio_player.dart b/lib/views/widgets/audio_player.dart index 1b929566..f4a5afe9 100644 --- a/lib/views/widgets/audio_player.dart +++ b/lib/views/widgets/audio_player.dart @@ -26,12 +26,12 @@ class AudioPlayerWidget extends StatefulWidget { : super(key: key); @override - _AudioPlayerState createState() => _AudioPlayerState(); + _PlayerState createState() => _PlayerState(); } enum AudioPlayerStatus { notDownloaded, downloading, downloaded } -class _AudioPlayerState extends State { +class _PlayerState extends State { AudioPlayerStatus status = AudioPlayerStatus.notDownloaded; final AudioPlayer audioPlayer = AudioPlayer(); @@ -64,7 +64,7 @@ class _AudioPlayerState extends State { @override void dispose() { - if (audioPlayer.state == AudioPlayerState.PLAYING) { + if (audioPlayer.state == PlayerState.PLAYING) { audioPlayer.stop(); } onAudioPositionChanged?.cancel(); @@ -106,7 +106,7 @@ class _AudioPlayerState extends State { void _playAction() async { if (AudioPlayerWidget.currentId != widget.event.eventId) { if (AudioPlayerWidget.currentId != null) { - if (audioPlayer.state != AudioPlayerState.STOPPED) { + if (audioPlayer.state != PlayerState.STOPPED) { await audioPlayer.stop(); setState(() => null); } @@ -114,13 +114,13 @@ class _AudioPlayerState extends State { AudioPlayerWidget.currentId = widget.event.eventId; } switch (audioPlayer.state) { - case AudioPlayerState.PLAYING: + case PlayerState.PLAYING: await audioPlayer.pause(); break; - case AudioPlayerState.PAUSED: + case PlayerState.PAUSED: await audioPlayer.resume(); break; - case AudioPlayerState.STOPPED: + case PlayerState.STOPPED: default: onAudioPositionChanged ??= audioPlayer.onAudioPositionChanged.listen((state) { @@ -172,12 +172,12 @@ class _AudioPlayerState extends State { ? CircularProgressIndicator(strokeWidth: 2) : IconButton( icon: Icon( - audioPlayer.state == AudioPlayerState.PLAYING + audioPlayer.state == PlayerState.PLAYING ? Icons.pause_outlined : Icons.play_arrow_outlined, color: widget.color, ), - tooltip: audioPlayer.state == AudioPlayerState.PLAYING + tooltip: audioPlayer.state == PlayerState.PLAYING ? L10n.of(context).audioPlayerPause : L10n.of(context).audioPlayerPlay, onPressed: () { diff --git a/pubspec.lock b/pubspec.lock index b6582234..a62b7a85 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -77,7 +77,7 @@ packages: name: audioplayers url: "https://pub.dartlang.org" source: hosted - version: "0.18.3" + version: "0.19.0" base58check: dependency: transitive description: @@ -217,7 +217,7 @@ packages: name: emoji_picker_flutter url: "https://pub.dartlang.org" source: hosted - version: "1.0.3" + version: "1.0.5" fake_async: dependency: transitive description: @@ -324,7 +324,7 @@ packages: name: flutter_cache_manager url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "3.0.2" flutter_highlight: dependency: transitive description: @@ -359,7 +359,7 @@ packages: name: flutter_local_notifications url: "https://pub.dartlang.org" source: hosted - version: "5.0.0+1" + version: "5.0.0+4" flutter_local_notifications_platform_interface: dependency: transitive description: @@ -439,7 +439,7 @@ packages: name: flutter_typeahead url: "https://pub.dartlang.org" source: hosted - version: "3.1.1" + version: "3.1.3" flutter_web_plugins: dependency: transitive description: flutter @@ -514,7 +514,7 @@ packages: name: image_picker url: "https://pub.dartlang.org" source: hosted - version: "0.7.4" + version: "0.7.5" image_picker_for_web: dependency: transitive description: @@ -633,7 +633,7 @@ packages: name: moor url: "https://pub.dartlang.org" source: hosted - version: "4.2.1" + version: "4.3.0" native_imaging: dependency: "direct main" description: @@ -691,7 +691,7 @@ packages: name: open_file url: "https://pub.dartlang.org" source: hosted - version: "3.2.0" + version: "3.2.1" open_noti_settings: dependency: "direct main" description: @@ -789,7 +789,7 @@ packages: name: permission_handler_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "3.2.0" + version: "3.3.0" petitparser: dependency: transitive description: @@ -1018,7 +1018,7 @@ packages: name: sqlite3 url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.1.1" stack_trace: dependency: transitive description: @@ -1095,7 +1095,7 @@ packages: name: tuple url: "https://pub.dartlang.org" source: hosted - version: "2.0.0-nullsafety.0" + version: "2.0.0" typed_data: dependency: transitive description: @@ -1130,7 +1130,7 @@ packages: name: unifiedpush url: "https://pub.dartlang.org" source: hosted - version: "1.0.2" + version: "1.0.3" universal_html: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index e7dd03f6..5f86bfb8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,7 +11,7 @@ dependencies: adaptive_page_layout: ^0.2.4 adaptive_theme: ^2.2.0 android_path_provider: ^0.2.1 - audioplayers: ^0.18.3 + audioplayers: ^0.19.0 cached_network_image: ^3.0.0 cupertino_icons: any desktop_notifications: ^0.4.0