chore: Update audioplayers

This commit is contained in:
Christian Pauly 2021-06-06 10:50:26 +02:00
parent 91c29ae266
commit f82ce1b000
3 changed files with 9 additions and 9 deletions

View File

@ -45,7 +45,7 @@ class _AudioPlayerState extends State<AudioPlayerWidget> {
@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<AudioPlayerWidget> {
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> {
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<AudioPlayerWidget> {
? 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: () {

View File

@ -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:

View File

@ -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