Skip to content

Commit

Permalink
fix: liked tracks card play not working
Browse files Browse the repository at this point in the history
  • Loading branch information
KRTirtho committed Sep 9, 2023
1 parent 142dc49 commit d3e1cef
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 21 deletions.
17 changes: 12 additions & 5 deletions lib/components/playlist/playlist_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,18 @@ class PlaylistCard extends HookConsumerWidget {
return audioPlayer.resume();
}

List<Track> fetchedTracks = await queryBowl.fetchQuery(
"playlist-tracks/${playlist.id}",
() => useQueries.playlist.tracksOf(playlist.id!, spotify, ref),
) ??
[];
List<Track> 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;

Expand Down
1 change: 1 addition & 0 deletions lib/themes/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
24 changes: 12 additions & 12 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
7 changes: 3 additions & 4 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -119,7 +119,6 @@ dev_dependencies:

dependency_overrides:
http: ^1.1.0
flutter_hooks: ^0.20.0

flutter:
generate: true
Expand Down

0 comments on commit d3e1cef

Please sign in to comment.