mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-12-25 06:52:35 +01:00
chore: Update audioplayers
This commit is contained in:
parent
91c29ae266
commit
f82ce1b000
@ -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: () {
|
||||
|
@ -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:
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user