fix progress tick
This commit is contained in:
parent
ea467129ee
commit
981b4836f9
1 changed files with 14 additions and 2 deletions
|
|
@ -121,7 +121,6 @@ class _HeroCard extends ConsumerWidget {
|
|||
final accent = Theme.of(context).colorScheme.primary;
|
||||
final client = ref.watch(subsonicClientProvider);
|
||||
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.
|
||||
final recent = ref.watch(recentSongsProvider);
|
||||
|
|
@ -215,7 +214,7 @@ class _HeroCard extends ConsumerWidget {
|
|||
style: const TextStyle(color: TimbreColors.dimmed)),
|
||||
if (hasCurrent) ...[
|
||||
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 {
|
||||
const _HeroShell(
|
||||
{required this.child, required this.accent, required this.onTap});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue