From d3e1cef8a21ef7d64e74ca4e99b4b57b653b60a7 Mon Sep 17 00:00:00 2001 From: Kingkor Roy Tirtho Date: Sat, 9 Sep 2023 17:37:24 +0600 Subject: [PATCH] fix: liked tracks card play not working --- lib/components/playlist/playlist_card.dart | 17 ++++++++++----- lib/themes/theme.dart | 1 + pubspec.lock | 24 +++++++++++----------- pubspec.yaml | 7 +++---- 4 files changed, 28 insertions(+), 21 deletions(-) diff --git a/lib/components/playlist/playlist_card.dart b/lib/components/playlist/playlist_card.dart index edb374c8a..3fb309525 100644 --- a/lib/components/playlist/playlist_card.dart +++ b/lib/components/playlist/playlist_card.dart @@ -60,11 +60,18 @@ class PlaylistCard extends HookConsumerWidget { return audioPlayer.resume(); } - List fetchedTracks = await queryBowl.fetchQuery( - "playlist-tracks/${playlist.id}", - () => useQueries.playlist.tracksOf(playlist.id!, spotify, ref), - ) ?? - []; + List fetchedTracks = playlist.id == 'user-liked-tracks' + ? await queryBowl.fetchQuery( + "user-liked-tracks", + () => useQueries.playlist.likedTracks(spotify, ref), + ) ?? + [] + : await queryBowl.fetchQuery( + "playlist-tracks/${playlist.id}", + () => useQueries.playlist + .tracksOf(playlist.id!, spotify, ref), + ) ?? + []; if (fetchedTracks.isEmpty) return; diff --git a/lib/themes/theme.dart b/lib/themes/theme.dart index 7f107d567..e11f0cc20 100644 --- a/lib/themes/theme.dart +++ b/lib/themes/theme.dart @@ -51,6 +51,7 @@ ThemeData theme(Color seed, Brightness brightness) { sliderTheme: SliderThemeData(overlayShape: SliderComponentShape.noOverlay), searchBarTheme: SearchBarThemeData( constraints: const BoxConstraints(maxWidth: double.infinity), + padding: const MaterialStatePropertyAll(EdgeInsets.all(8)), backgroundColor: MaterialStatePropertyAll( Color.lerp( scheme.surfaceVariant, diff --git a/pubspec.lock b/pubspec.lock index e596944e5..9d903a25e 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -518,26 +518,26 @@ packages: dependency: "direct main" description: name: fl_query - sha256: "64f482fc09eb1166adca232f68772b2b11c616d88bce3208b2753c940ebc9f71" + sha256: "3d71cd1eeb3232efa5e32363a351d74fd9ff07c6eb80aeb672b1970962764945" url: "https://pub.dev" source: hosted - version: "1.0.0-alpha.3" + version: "1.0.0-alpha.4" fl_query_devtools: dependency: "direct main" description: name: fl_query_devtools - sha256: f46148364d7fc49fb02ab2d3b2c280e6652edd3984e9fdf14c1b49d4d8473907 + sha256: "72fac45293902b9f99c726609cd5416573566cce0b7c6e27311efde7fdf1b8b1" url: "https://pub.dev" source: hosted - version: "0.1.0-alpha.1" + version: "0.1.0-alpha.2" fl_query_hooks: dependency: "direct main" description: name: fl_query_hooks - sha256: b0ffc81fb047cbcedd9766776f9c72b95382730ce173226f0695c3f45774b0bc + sha256: "7f0880696666714f77981777509a8aedb765857dcdbdde23e623da20a24c4ae0" url: "https://pub.dev" source: hosted - version: "1.0.0-alpha.3" + version: "1.0.0-alpha.4+1" fluentui_system_icons: dependency: "direct main" description: @@ -702,10 +702,10 @@ packages: dependency: "direct main" description: name: flutter_riverpod - sha256: "0c997763ce06359ee4686553b74def84062e9d6929ac63f61fa02465c1f8e32c" + sha256: "1bd39b04f1bcd217a969589777ca6bd642d116e3e5de65c3e6a8e8bdd8b178ec" url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "2.4.0" flutter_rust_bridge: dependency: transitive description: @@ -901,10 +901,10 @@ packages: dependency: "direct main" description: name: hooks_riverpod - sha256: "71695b2e1dfc22a39f1f9c67b798f8f8f1521f2d0349817d13ccdd5c4cd7acba" + sha256: ad7b877c3687e38764633d221a1f65491bc7a540e724101e9a404a84db2a4276 url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "2.4.0" html: dependency: "direct main" description: @@ -1490,10 +1490,10 @@ packages: dependency: transitive description: name: riverpod - sha256: "0f43c64f1f79c2112c843305a879a746587fb7c1e388f1d4717737796756e2c4" + sha256: a600120d6f213a9922860eea1abc32597436edd5b2c4e73b91410f8c2af67d22 url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "2.4.0" rxdart: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 78fc28293..a7d43bf10 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -34,9 +34,9 @@ dependencies: duration: ^3.0.12 envied: ^0.3.0 file_picker: ^5.2.2 - fl_query: ^1.0.0-alpha.3 - fl_query_hooks: ^1.0.0-alpha.3 - fl_query_devtools: ^0.1.0-alpha.1 + fl_query: ^1.0.0-alpha.4 + fl_query_hooks: ^1.0.0-alpha.4+1 + fl_query_devtools: ^0.1.0-alpha.2 fluentui_system_icons: ^1.1.189 flutter: sdk: flutter @@ -119,7 +119,6 @@ dev_dependencies: dependency_overrides: http: ^1.1.0 - flutter_hooks: ^0.20.0 flutter: generate: true