From be59ae6750393ab38f042835acc2a432af18c2a0 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Sun, 6 Jun 2021 10:50:26 +0200 Subject: [PATCH] chore: Update audioplayers --- lib/widgets/event_content/audio_player.dart | 14 +++++++------- pubspec.lock | 2 +- pubspec.yaml | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/widgets/event_content/audio_player.dart b/lib/widgets/event_content/audio_player.dart index 22f0c889..fd70b098 100644 --- a/lib/widgets/event_content/audio_player.dart +++ b/lib/widgets/event_content/audio_player.dart @@ -45,7 +45,7 @@ class _AudioPlayerState extends State { @override void dispose() { - if (audioPlayer.state == AudioPlayerState.PLAYING) { + if (audioPlayer.state == PlayerState.PLAYING) { audioPlayer.stop(); } onAudioPositionChanged?.cancel(); @@ -87,7 +87,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); } @@ -95,13 +95,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) { @@ -143,12 +143,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 03afff0a..77b93559 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -70,7 +70,7 @@ packages: name: audioplayers url: "https://pub.dartlang.org" source: hosted - version: "0.18.3" + version: "0.19.0" base58check: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 16700eeb..785dc192 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -10,7 +10,7 @@ dependencies: adaptive_dialog: ^0.10.0+5 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