fix(player): restore playback position reliably

This commit is contained in:
zarzet
2026-07-29 21:03:11 +07:00
parent 43a8d08851
commit 04a8700a65
6 changed files with 213 additions and 53 deletions
+12 -2
View File
@@ -24,6 +24,7 @@ class _MiniPlayerState extends ConsumerState<MiniPlayer> {
if (mediaItem == null) return const SizedBox.shrink();
final isPlaying = ref.watch(playbackPlayingProvider);
final isLoading = ref.watch(playbackLoadingProvider);
if (mediaItem.id == _dismissedItemId && !isPlaying) {
return const SizedBox.shrink();
}
@@ -112,8 +113,17 @@ class _MiniPlayerState extends ConsumerState<MiniPlayer> {
),
),
IconButton(
icon: Icon(isPlaying ? Icons.pause : Icons.play_arrow),
onPressed: () => controller.togglePlayPause(isPlaying),
icon: isLoading
? const SizedBox.square(
dimension: 20,
child: CircularProgressIndicator(
strokeWidth: 2.5,
),
)
: Icon(isPlaying ? Icons.pause : Icons.play_arrow),
onPressed: isLoading
? null
: () => controller.togglePlayPause(isPlaying),
),
IconButton(
icon: const Icon(Icons.skip_next),