mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-27 06:39:25 +01:00
feat: Update audio_players to newest version
This commit is contained in:
parent
c0d446b41e
commit
6432b4cd4b
@ -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<AudioPlayerWidget> {
|
||||
class _PlayerState extends State<AudioPlayerWidget> {
|
||||
AudioPlayerStatus status = AudioPlayerStatus.notDownloaded;
|
||||
final AudioPlayer audioPlayer = AudioPlayer();
|
||||
|
||||
@ -64,7 +64,7 @@ class _AudioPlayerState extends State<AudioPlayerWidget> {
|
||||
|
||||
@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<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);
|
||||
}
|
||||
@ -114,13 +114,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) {
|
||||
@ -172,12 +172,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: () {
|
||||
|
24
pubspec.lock
24
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:
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user