@@ -418,7 +418,7 @@ class FullPlayerSheet extends StatelessWidget {
418418 YoutubeThumbnailUtils .preferredArtworkScale (
419419 songId: currentSong? .id,
420420 imageUrl: now.imageUrl,
421- youtubeVideoScale: 1.9 ,
421+ youtubeVideoScale: 1.0 ,
422422 normalScale: 1.0 ,
423423 );
424424 final currentArtCandidates =
@@ -998,7 +998,7 @@ class FullPlayerSheet extends StatelessWidget {
998998 .song
999999 .meta
10001000 .imageUrl,
1001- youtubeVideoScale: 1.9 ,
1001+ youtubeVideoScale: 1.0 ,
10021002 normalScale: 1.0 ,
10031003 ),
10041004 child: FallbackNetworkImage (
@@ -1217,6 +1217,26 @@ class _QueuedDownloadTask {
12171217}
12181218
12191219void _showAddToPlaylistSheet (BuildContext context, QueuedSong song) {
1220+ final stableContext = context;
1221+ final rootNavigator = Navigator .of (stableContext, rootNavigator: true );
1222+ final useGlassTheme = Provider .of <ThemeProvider >(
1223+ context,
1224+ listen: false ,
1225+ ).useGlassTheme;
1226+ final addedInSheet = < String > {};
1227+
1228+ IconData playlistIcon () {
1229+ return useGlassTheme
1230+ ? CupertinoIcons .music_note_list
1231+ : Icons .playlist_add_rounded;
1232+ }
1233+
1234+ IconData addedIcon () {
1235+ return useGlassTheme
1236+ ? CupertinoIcons .check_mark_circled_solid
1237+ : Icons .check_circle;
1238+ }
1239+
12201240 showModalBottomSheet (
12211241 context: context,
12221242 isScrollControlled: true ,
@@ -1346,57 +1366,8 @@ void _showAddToPlaylistSheet(BuildContext context, QueuedSong song) {
13461366 ],
13471367 ),
13481368 ),
1349- const SizedBox (height: 12 ),
1350-
1351- if (playlists.isEmpty)
1352- const Text (
1353- 'No playlists yet' ,
1354- style: TextStyle (color: Colors .white54),
1355- ),
1356-
1357- ...playlists.keys
1358- .where ((name) => name != PlaylistManager .systemFavourites)
1359- .map (
1360- (name) => ListTile (
1361- leading: const Icon (CupertinoIcons .music_note_list),
1362- title: Text (name),
1363- onTap: () async {
1364- final navigator = Navigator .of (context);
1365- final success = await PlaylistManager .addSong (name, {
1366- 'id' : song.id,
1367- 'title' : song.meta.title,
1368- 'artist' : song.meta.artist,
1369- 'imageUrl' : song.meta.imageUrl,
1370- });
1371-
1372- navigator.pop ();
1373-
1374- if (success) {
1375- AppMessenger .show (
1376- 'Added to "$name "' ,
1377- color: Colors .green.shade700,
1378- );
1379- } else {
1380- AppMessenger .show (
1381- 'Already in "$name "' ,
1382- color: Colors .orange.shade700,
1383- );
1384- }
1385- },
1386- ),
1387- ),
1388-
1389- const SizedBox (height: 8 ),
1390-
1391- TextButton (
1392- onPressed: () async {
1393- Navigator .pop (context);
1394- _showCreatePlaylistDialog (context);
1395- },
1396- child: const Text ('+ Create new playlist' ),
1397- ),
1398- ],
1399- ),
1369+ );
1370+ },
14001371 );
14011372 },
14021373 );
@@ -1407,7 +1378,7 @@ void _showAddToPlaylistSheet(BuildContext context, QueuedSong song) {
14071378void _showCreatePlaylistDialog (BuildContext context) {
14081379 final controller = TextEditingController ();
14091380
1410- showDialog (
1381+ showDialog < void > (
14111382 context: context,
14121383 builder: (dialogContext) => AlertDialog (
14131384 scrollable: true ,
@@ -1418,17 +1389,21 @@ void _showCreatePlaylistDialog(BuildContext context) {
14181389 ),
14191390 actions: [
14201391 TextButton (
1421- onPressed: () => Navigator .pop (context),
1392+ onPressed: () {
1393+ FocusScope .of (dialogContext).unfocus ();
1394+ Navigator .of (dialogContext).pop ();
1395+ },
14221396 child: const Text ('Cancel' ),
14231397 ),
14241398 TextButton (
14251399 onPressed: () async {
14261400 final name = controller.text.trim ();
14271401 if (name.isEmpty) return ;
14281402
1429- final navigator = Navigator .of (context );
1403+ FocusScope .of (dialogContext). unfocus ( );
14301404 await PlaylistManager .create (name);
1431- navigator.pop ();
1405+ if (! dialogContext.mounted) return ;
1406+ Navigator .of (dialogContext).pop ();
14321407 AppMessenger .show (
14331408 'Playlist "$name " created' ,
14341409 color: Colors .green.shade700,
0 commit comments