Skip to content

Commit

Permalink
fix(playlist_bar): update playlist data handling after navigation (go…
Browse files Browse the repository at this point in the history
  • Loading branch information
gokadzev committed Dec 29, 2024
1 parent b881cb2 commit 3b9ea5d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/widgets/playlist_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class PlaylistBar extends StatelessWidget {
@override
Widget build(BuildContext context) {
final primaryColor = Theme.of(context).colorScheme.primary;
Map<dynamic, dynamic>? updatedPlaylist;
return Padding(
padding: commonBarPadding,
child: GestureDetector(
Expand All @@ -61,10 +62,18 @@ class PlaylistBar extends StatelessWidget {
MaterialPageRoute(
builder: (context) => PlaylistPage(
playlistId: playlistId,
playlistData: playlistData,
playlistData: updatedPlaylist ?? playlistData,
),
),
);
).then((isPlaylistUpdated) {
if (isPlaylistUpdated != null && isPlaylistUpdated) {
getPlaylistInfoForWidget(playlistId).then(
(result) => {
updatedPlaylist = result,
},
);
}
});
},
child: Card(
shape: RoundedRectangleBorder(
Expand Down

0 comments on commit 3b9ea5d

Please sign in to comment.