From 252e4619f7ddac9307fa3e9c0ee176825d2852f1 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Fri, 6 Sep 2024 16:22:39 +0800 Subject: [PATCH] :bug: Fix player view layout issue --- lib/screens/player/view.dart | 146 +++++++++--------- .../sourced_track/sources/netease.dart | 1 - 2 files changed, 74 insertions(+), 73 deletions(-) diff --git a/lib/screens/player/view.dart b/lib/screens/player/view.dart index a4ce4d1..99c4e5f 100644 --- a/lib/screens/player/view.dart +++ b/lib/screens/player/view.dart @@ -309,87 +309,89 @@ class _PlayerScreenState extends State { ], ), const Gap(20), - SizedBox( - height: 40, - child: ListView( - scrollDirection: Axis.horizontal, - shrinkWrap: true, - children: [ - TextButton.icon( - icon: const Icon(Icons.queue_music), - label: const Text( - 'Queue', - maxLines: 1, - overflow: TextOverflow.fade, - ), - onPressed: () { - showModalBottomSheet( - useRootNavigator: true, - isScrollControlled: true, - context: context, - builder: (context) => - const PlayerQueuePopup(), - ).then((_) { - if (mounted) { - setState(() {}); - } - }); - }, - ), - if (!isLargeScreen) const Gap(4), - if (!isLargeScreen) + Center( + child: SizedBox( + height: 40, + child: ListView( + scrollDirection: Axis.horizontal, + shrinkWrap: true, + children: [ TextButton.icon( - icon: const Icon(Icons.lyrics), + icon: const Icon(Icons.queue_music), label: const Text( - 'Lyrics', + 'Queue', maxLines: 1, overflow: TextOverflow.fade, ), onPressed: () { - GoRouter.of(context) - .pushNamed('playerLyrics'); + showModalBottomSheet( + useRootNavigator: true, + isScrollControlled: true, + context: context, + builder: (context) => + const PlayerQueuePopup(), + ).then((_) { + if (mounted) { + setState(() {}); + } + }); }, ), - const Gap(4), - TextButton.icon( - icon: const Icon(Icons.merge), - label: const Text( - 'Sources', - maxLines: 1, - overflow: TextOverflow.fade, + if (!isLargeScreen) const Gap(4), + if (!isLargeScreen) + TextButton.icon( + icon: const Icon(Icons.lyrics), + label: const Text( + 'Lyrics', + maxLines: 1, + overflow: TextOverflow.fade, + ), + onPressed: () { + GoRouter.of(context) + .pushNamed('playerLyrics'); + }, + ), + const Gap(4), + TextButton.icon( + icon: const Icon(Icons.merge), + label: const Text( + 'Sources', + maxLines: 1, + overflow: TextOverflow.fade, + ), + onPressed: () { + showModalBottomSheet( + useRootNavigator: true, + isScrollControlled: true, + context: context, + builder: (context) => + const SiblingTracksPopup(), + ).then((_) { + if (mounted) { + setState(() {}); + } + }); + }, ), - onPressed: () { - showModalBottomSheet( - useRootNavigator: true, - isScrollControlled: true, - context: context, - builder: (context) => - const SiblingTracksPopup(), - ).then((_) { - if (mounted) { - setState(() {}); - } - }); - }, - ), - const Gap(4), - TextButton.icon( - label: const Text('Info'), - icon: const Icon(Icons.info), - onPressed: () { - showModalBottomSheet( - useRootNavigator: true, - context: context, - builder: (context) => - const SourceDetailsPopup(), - ).then((_) { - if (mounted) { - setState(() {}); - } - }); - }, - ), - ], + const Gap(4), + TextButton.icon( + label: const Text('Info'), + icon: const Icon(Icons.info), + onPressed: () { + showModalBottomSheet( + useRootNavigator: true, + context: context, + builder: (context) => + const SourceDetailsPopup(), + ).then((_) { + if (mounted) { + setState(() {}); + } + }); + }, + ), + ], + ), ), ), ], diff --git a/lib/services/sourced_track/sources/netease.dart b/lib/services/sourced_track/sources/netease.dart index c319bd4..fe6b211 100755 --- a/lib/services/sourced_track/sources/netease.dart +++ b/lib/services/sourced_track/sources/netease.dart @@ -111,7 +111,6 @@ class NeteaseSourcedTrack extends SourcedTrack { final client = getClient(); final resp = await client.get('/song/detail?ids=${cachedSource.sourceId}'); - print(resp.body); final item = resp.body['songs'][0]; return NeteaseSourcedTrack(