This commit is contained in:
Forrest 2026-08-05 21:57:06 -04:00
parent 2ce32cac4e
commit b6639fb1c9
26 changed files with 454 additions and 204 deletions

View file

@ -61,7 +61,7 @@ class _NowPlayingScreenState extends ConsumerState<NowPlayingScreen> {
(_, _) => _seedFavorites());
if (current == null) {
return const Center(
return Center(
child: Text('Nothing playing.',
style: TextStyle(color: TimbreColors.dimmed)),
);
@ -84,8 +84,8 @@ class _NowPlayingScreenState extends ConsumerState<NowPlayingScreen> {
const SizedBox(height: TimbreSpacing.xs),
_Transport(state: state, ref: ref, accent: accent),
if (!state.supported)
const Padding(
padding: EdgeInsets.only(top: TimbreSpacing.sm),
Padding(
padding: const EdgeInsets.only(top: TimbreSpacing.sm),
child: Text(
'Audio output unavailable on this platform — test on Android/iOS.',
style: TextStyle(color: TimbreColors.dimmed, fontSize: 11),
@ -266,10 +266,12 @@ class _QueuePanel extends ConsumerStatefulWidget {
class _QueuePanelState extends ConsumerState<_QueuePanel> {
/// Fixed row height: a [TimbreSpacing.minTouchTarget] tall remove button plus
/// the [TimbreSpacing.xs] vertical padding above and below it. Pinning the
/// extent lets us scroll to a row by index without measuring.
/// the [TimbreSpacing.xs] vertical padding above and below it, with an extra
/// [TimbreSpacing.md] of headroom so the two-line title/artist column has
/// breathing room and never overflows the pinned extent. Pinning the extent
/// lets us scroll to a row by index without measuring.
static const double _rowExtent =
TimbreSpacing.minTouchTarget + TimbreSpacing.xs * 2;
TimbreSpacing.minTouchTarget + TimbreSpacing.md + TimbreSpacing.xs * 2;
final ScrollController _controller = ScrollController();
bool _didInitialScroll = false;
@ -358,28 +360,45 @@ class _QueuePanelState extends ConsumerState<_QueuePanel> {
maxLines: 1,
softWrap: false,
overflow: TextOverflow.clip,
style: const TextStyle(color: TimbreColors.dimmed),
style: TextStyle(color: TimbreColors.dimmed),
),
),
Expanded(
child: Text(
song.title ?? 'Untitled',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: titleColor,
fontWeight:
isCurrent ? FontWeight.w700 : FontWeight.w400,
),
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
song.title ?? 'Untitled',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: titleColor,
fontWeight:
isCurrent ? FontWeight.w700 : FontWeight.w400,
),
),
if (song.artist != null)
Text(
song.artist!,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: TimbreColors.dimmed,
fontSize: 12,
),
),
],
),
),
Text(_fmt(song.duration),
style: const TextStyle(color: TimbreColors.dimmed)),
style: TextStyle(color: TimbreColors.dimmed)),
InkWell(
onTap: () =>
ref.read(playbackCommandsProvider).removeAt(i),
customBorder: const CircleBorder(),
child: const SizedBox(
child: SizedBox(
width: TimbreSpacing.minTouchTarget,
height: TimbreSpacing.minTouchTarget,
child: Icon(Icons.close,
@ -520,8 +539,8 @@ class _FavRating extends ConsumerWidget {
InkWell(
onTap: () => showAddToPlaylistSheet(context, songs: [song]),
customBorder: const CircleBorder(),
child: const Padding(
padding: EdgeInsets.all(TimbreSpacing.sm),
child: Padding(
padding: const EdgeInsets.all(TimbreSpacing.sm),
child: Icon(Icons.playlist_add,
size: 22, color: TimbreColors.dimmed),
),
@ -623,9 +642,9 @@ class _InfoStrip extends StatelessWidget {
overflow: TextOverflow.ellipsis,
style: TextStyle(color: accent, fontWeight: FontWeight.w700)),
Text(song.artist ?? 'Unknown artist',
style: const TextStyle(color: TimbreColors.foreground)),
style: TextStyle(color: TimbreColors.foreground)),
if (album.isNotEmpty)
Text(album, style: const TextStyle(color: TimbreColors.dimmed)),
Text(album, style: TextStyle(color: TimbreColors.dimmed)),
],
);
}
@ -647,14 +666,14 @@ class _NowPlayingProgress extends ConsumerWidget {
return Row(
children: [
Text(_fmtDur(position),
style: const TextStyle(color: TimbreColors.dimmed)),
style: TextStyle(color: TimbreColors.dimmed)),
const SizedBox(width: TimbreSpacing.md),
Expanded(
child: BlockProgressBar(progress: progress, cells: 28, height: 18),
),
const SizedBox(width: TimbreSpacing.md),
Text(_fmtDur(duration),
style: const TextStyle(color: TimbreColors.dimmed)),
style: TextStyle(color: TimbreColors.dimmed)),
],
);
}
@ -692,10 +711,10 @@ class _Transport extends StatelessWidget {
}
Widget _btn(IconData icon, VoidCallback onTap,
{Color color = TimbreColors.foreground, double size = 28}) {
{Color? color, double size = 28}) {
return IconButton(
onPressed: onTap,
icon: Icon(icon, color: color, size: size),
icon: Icon(icon, color: color ?? TimbreColors.foreground, size: size),
);
}
}
@ -703,7 +722,7 @@ class _Transport extends StatelessWidget {
class _ArtFallback extends StatelessWidget {
const _ArtFallback();
@override
Widget build(BuildContext context) => const Center(
Widget build(BuildContext context) => Center(
child: Icon(Icons.album_outlined,
color: TimbreColors.dimmed, size: 48),
);