fix progress tick

This commit is contained in:
Forrest 2026-07-29 16:43:03 -04:00
parent ea467129ee
commit 981b4836f9

View file

@ -121,7 +121,6 @@ class _HeroCard extends ConsumerWidget {
final accent = Theme.of(context).colorScheme.primary; final accent = Theme.of(context).colorScheme.primary;
final client = ref.watch(subsonicClientProvider); final client = ref.watch(subsonicClientProvider);
final current = ref.watch(playbackProvider.select((s) => s.current)); final current = ref.watch(playbackProvider.select((s) => s.current));
final progress = ref.watch(playbackProvider.select((s) => s.progress));
// Fall back to the most recent track so the hero is useful before playback. // Fall back to the most recent track so the hero is useful before playback.
final recent = ref.watch(recentSongsProvider); final recent = ref.watch(recentSongsProvider);
@ -215,7 +214,7 @@ class _HeroCard extends ConsumerWidget {
style: const TextStyle(color: TimbreColors.dimmed)), style: const TextStyle(color: TimbreColors.dimmed)),
if (hasCurrent) ...[ if (hasCurrent) ...[
const SizedBox(height: TimbreSpacing.md), const SizedBox(height: TimbreSpacing.md),
BlockProgressBar(progress: progress, cells: 32, height: 6), const _HeroProgress(),
], ],
], ],
), ),
@ -226,6 +225,19 @@ class _HeroCard extends ConsumerWidget {
} }
} }
/// The hero's block progress bar. Isolated so position ticks rebuild only this
/// strip, not the whole card (which would flash the album art). Mirrors the
/// mini-player's `_MiniProgress`.
class _HeroProgress extends ConsumerWidget {
const _HeroProgress();
@override
Widget build(BuildContext context, WidgetRef ref) {
final progress = ref.watch(playbackProvider.select((s) => s.progress));
return BlockProgressBar(progress: progress, cells: 32, height: 6);
}
}
class _HeroShell extends StatelessWidget { class _HeroShell extends StatelessWidget {
const _HeroShell( const _HeroShell(
{required this.child, required this.accent, required this.onTap}); {required this.child, required this.accent, required this.onTap});