diff --git a/lib/provider/player_provider.dart b/lib/provider/player_provider.dart index f8a6582..750d759 100644 --- a/lib/provider/player_provider.dart +++ b/lib/provider/player_provider.dart @@ -25,7 +25,7 @@ class PlayerProvider extends ChangeNotifier { androidNotificationChannelName: appName, androidNotificationOngoing: true, androidShowNotificationBadge: true, - androidNotificationIcon: "mipmap/launcher_icon", + androidNotificationIcon: "mipmap/ic_launcher", ), ); positionStream = await _audioHandler!.customAction('positionStream'); @@ -50,12 +50,13 @@ class PlayerProvider extends ChangeNotifier { if (globalQueue.isNotEmpty) await _audioHandler!.addQueueItems(globalQueue); } - play(int index) async { + play(String id) async { if (globalQueue.isEmpty) { return; } - globalIndex = index; - await _audioHandler!.skipToQueueItem(index); + globalIndex = + globalQueue.indexWhere((element) => element.id == id); + await _audioHandler!.skipToQueueItem(globalIndex!); await _audioHandler!.play(); } diff --git a/lib/view/playback_controls.dart b/lib/view/playback_controls.dart index e8fe40a..5bc5b7c 100644 --- a/lib/view/playback_controls.dart +++ b/lib/view/playback_controls.dart @@ -49,12 +49,9 @@ class _PlayBackControlsState extends State topLeft: Radius.circular(20), topRight: Radius.circular(20), ), - child: BackdropFilter( - filter: new ImageFilter.blur(sigmaX: 20.0, sigmaY: 20.0), - child: CollapsedControls( - provider: playerProvider, - panelController: panelController, - ), + child: CollapsedControls( + provider: playerProvider, + panelController: panelController, ), ), renderPanelSheet: false, diff --git a/lib/widgets/collapsed_controls.dart b/lib/widgets/collapsed_controls.dart index cd6d202..2476b0c 100644 --- a/lib/widgets/collapsed_controls.dart +++ b/lib/widgets/collapsed_controls.dart @@ -1,3 +1,5 @@ +import 'dart:ui'; + import 'package:flutter/material.dart'; import 'package:sliding_up_panel/sliding_up_panel.dart'; @@ -17,20 +19,23 @@ class CollapsedControls extends StatelessWidget { @override Widget build(BuildContext context) { - return Container( - height: MediaQuery.of(context).size.height * 0.2, - child: Padding( - padding: const EdgeInsets.all(3.0), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - SeekBar(), - PlayBackControlButtons( - provider: provider, - isCollapsed: true, - panelController: panelController, - ), - ], + return BackdropFilter( + filter: new ImageFilter.blur(sigmaX: 20.0, sigmaY: 20.0), + child: Container( + height: MediaQuery.of(context).size.height * 0.2, + child: Padding( + padding: const EdgeInsets.all(3.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + SeekBar(), + PlayBackControlButtons( + provider: provider, + isCollapsed: true, + panelController: panelController, + ), + ], + ), ), ), ); diff --git a/lib/widgets/song_card.dart b/lib/widgets/song_card.dart index df332e7..30dd1bd 100644 --- a/lib/widgets/song_card.dart +++ b/lib/widgets/song_card.dart @@ -32,7 +32,7 @@ class SongCard extends StatelessWidget { borderRadius: BorderRadius.all(Radius.circular(24))), child: InkWell( onTap: () { - provider.play(songIndex); + provider.play(song.id.toString()); playPauseController.forward(); }, child: Card( diff --git a/pubspec.lock b/pubspec.lock index d0f9686..e04980b 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -21,7 +21,7 @@ packages: name: archive url: "https://pub.dartlang.org" source: hosted - version: "3.1.8" + version: "3.1.11" args: dependency: transitive description: @@ -189,7 +189,7 @@ packages: name: file_picker url: "https://pub.dartlang.org" source: hosted - version: "4.3.2" + version: "4.3.3" flutter: dependency: "direct main" description: flutter @@ -309,21 +309,21 @@ packages: name: just_audio url: "https://pub.dartlang.org" source: hosted - version: "0.9.18" + version: "0.9.19" just_audio_platform_interface: dependency: transitive description: name: just_audio_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "4.0.0" + version: "4.1.0" just_audio_web: dependency: transitive description: name: just_audio_web url: "https://pub.dartlang.org" source: hosted - version: "0.4.2" + version: "0.4.4" marquee: dependency: "direct main" description: @@ -358,21 +358,21 @@ packages: name: on_audio_query url: "https://pub.dartlang.org" source: hosted - version: "2.5.3" + version: "2.6.0" on_audio_query_platform_interface: dependency: transitive description: name: on_audio_query_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.3.1" + version: "1.4.0" on_audio_query_web: dependency: transitive description: name: on_audio_query_web url: "https://pub.dartlang.org" source: hosted - version: "1.3.2" + version: "1.3.2+2" open_file: dependency: "direct main" description: @@ -393,14 +393,14 @@ packages: name: path_provider url: "https://pub.dartlang.org" source: hosted - version: "2.0.7" + version: "2.0.8" path_provider_android: dependency: transitive description: name: path_provider_android url: "https://pub.dartlang.org" source: hosted - version: "2.0.9" + version: "2.0.11" path_provider_ios: dependency: transitive description: @@ -414,28 +414,28 @@ packages: name: path_provider_linux url: "https://pub.dartlang.org" source: hosted - version: "2.1.2" + version: "2.1.5" path_provider_macos: dependency: transitive description: name: path_provider_macos url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "2.0.5" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.0.3" path_provider_windows: dependency: transitive description: name: path_provider_windows url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" + version: "2.0.5" pedantic: dependency: transitive description: @@ -456,14 +456,14 @@ packages: name: platform url: "https://pub.dartlang.org" source: hosted - version: "3.0.2" + version: "3.1.0" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.1.2" process: dependency: transitive description: @@ -477,7 +477,7 @@ packages: name: provider url: "https://pub.dartlang.org" source: hosted - version: "6.0.1" + version: "6.0.2" receive_sharing_intent: dependency: "direct main" description: @@ -505,28 +505,28 @@ packages: name: shared_preferences url: "https://pub.dartlang.org" source: hosted - version: "2.0.9" + version: "2.0.13" shared_preferences_android: dependency: transitive description: name: shared_preferences_android url: "https://pub.dartlang.org" source: hosted - version: "2.0.9" + version: "2.0.10" shared_preferences_ios: dependency: transitive description: name: shared_preferences_ios url: "https://pub.dartlang.org" source: hosted - version: "2.0.8" + version: "2.0.9" shared_preferences_linux: dependency: transitive description: name: shared_preferences_linux url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "2.0.4" shared_preferences_macos: dependency: transitive description: @@ -547,14 +547,14 @@ packages: name: shared_preferences_web url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.0.3" shared_preferences_windows: dependency: transitive description: name: shared_preferences_windows url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "2.0.4" sky_engine: dependency: transitive description: flutter @@ -580,14 +580,14 @@ packages: name: sqflite url: "https://pub.dartlang.org" source: hosted - version: "2.0.0+4" + version: "2.0.2" sqflite_common: dependency: transitive description: name: sqflite_common url: "https://pub.dartlang.org" source: hosted - version: "2.0.1+1" + version: "2.2.0" stack_trace: dependency: transitive description: @@ -664,42 +664,42 @@ packages: name: webview_flutter url: "https://pub.dartlang.org" source: hosted - version: "2.3.1" + version: "2.8.0" webview_flutter_android: dependency: transitive description: name: webview_flutter_android url: "https://pub.dartlang.org" source: hosted - version: "2.3.1" + version: "2.8.2" webview_flutter_platform_interface: dependency: transitive description: name: webview_flutter_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.5.2" + version: "1.8.1" webview_flutter_wkwebview: dependency: transitive description: name: webview_flutter_wkwebview url: "https://pub.dartlang.org" source: hosted - version: "2.4.0" + version: "2.7.1" win32: dependency: transitive description: name: win32 url: "https://pub.dartlang.org" source: hosted - version: "2.3.1" + version: "2.3.11" xdg_directories: dependency: transitive description: name: xdg_directories url: "https://pub.dartlang.org" source: hosted - version: "0.2.0" + version: "0.2.0+1" xml: dependency: transitive description: @@ -722,5 +722,5 @@ packages: source: hosted version: "1.10.9+1" sdks: - dart: ">=2.14.0 <3.0.0" + dart: ">=2.15.0 <3.0.0" flutter: ">=2.5.0"