From 3b9ea5d2517bacbcb9a67aaed9d5bb2c4f3b2d47 Mon Sep 17 00:00:00 2001 From: Valeri Gokadze Date: Sun, 29 Dec 2024 16:28:43 +0400 Subject: [PATCH] fix(playlist_bar): update playlist data handling after navigation (#480) --- lib/widgets/playlist_bar.dart | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/widgets/playlist_bar.dart b/lib/widgets/playlist_bar.dart index 53429568..fee9cf7d 100644 --- a/lib/widgets/playlist_bar.dart +++ b/lib/widgets/playlist_bar.dart @@ -51,6 +51,7 @@ class PlaylistBar extends StatelessWidget { @override Widget build(BuildContext context) { final primaryColor = Theme.of(context).colorScheme.primary; + Map? updatedPlaylist; return Padding( padding: commonBarPadding, child: GestureDetector( @@ -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(