🐛 Fix player view layout issue

This commit is contained in:
LittleSheep 2024-09-06 16:22:39 +08:00
parent 463cb9870f
commit 252e4619f7
2 changed files with 74 additions and 73 deletions

View File

@ -309,87 +309,89 @@ class _PlayerScreenState extends State<PlayerScreen> {
], ],
), ),
const Gap(20), const Gap(20),
SizedBox( Center(
height: 40, child: SizedBox(
child: ListView( height: 40,
scrollDirection: Axis.horizontal, child: ListView(
shrinkWrap: true, scrollDirection: Axis.horizontal,
children: [ shrinkWrap: true,
TextButton.icon( children: [
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)
TextButton.icon( TextButton.icon(
icon: const Icon(Icons.lyrics), icon: const Icon(Icons.queue_music),
label: const Text( label: const Text(
'Lyrics', 'Queue',
maxLines: 1, maxLines: 1,
overflow: TextOverflow.fade, overflow: TextOverflow.fade,
), ),
onPressed: () { onPressed: () {
GoRouter.of(context) showModalBottomSheet(
.pushNamed('playerLyrics'); useRootNavigator: true,
isScrollControlled: true,
context: context,
builder: (context) =>
const PlayerQueuePopup(),
).then((_) {
if (mounted) {
setState(() {});
}
});
}, },
), ),
const Gap(4), if (!isLargeScreen) const Gap(4),
TextButton.icon( if (!isLargeScreen)
icon: const Icon(Icons.merge), TextButton.icon(
label: const Text( icon: const Icon(Icons.lyrics),
'Sources', label: const Text(
maxLines: 1, 'Lyrics',
overflow: TextOverflow.fade, 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: () { const Gap(4),
showModalBottomSheet( TextButton.icon(
useRootNavigator: true, label: const Text('Info'),
isScrollControlled: true, icon: const Icon(Icons.info),
context: context, onPressed: () {
builder: (context) => showModalBottomSheet(
const SiblingTracksPopup(), useRootNavigator: true,
).then((_) { context: context,
if (mounted) { builder: (context) =>
setState(() {}); 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(() {});
}
});
},
),
],
), ),
), ),
], ],

View File

@ -111,7 +111,6 @@ class NeteaseSourcedTrack extends SourcedTrack {
final client = getClient(); final client = getClient();
final resp = await client.get('/song/detail?ids=${cachedSource.sourceId}'); final resp = await client.get('/song/detail?ids=${cachedSource.sourceId}');
print(resp.body);
final item = resp.body['songs'][0]; final item = resp.body['songs'][0];
return NeteaseSourcedTrack( return NeteaseSourcedTrack(