feat(player): resume last session on launch (#54)
The #52 teardown clears the session when idle/dismissed, so the headset / lock-screen play button had nothing to resume and the user lost their place. - track.dart: toJson() (round-trips fromJson) - db.dart: CachedResumeState single-row snapshot, schema 9->10 + migration - audio_handler.dart: queuedTracks getter - player_provider.dart: restoreQueue() — configure + setQueueFromTracks + seek, no play (restores PAUSED) - resume_controller.dart: restores last snapshot paused on launch; persists {source,index,position_ms,tracks} debounced on track change / pause and immediately on app teardown; never clobbers the saved snapshot when the queue is empty so a teardown stays recoverable; restore gated on auth + no active session - app.dart: wired into postFrame db.g.dart regenerated by CI per project convention. Deferred fast-follow: media-button-when-fully-stopped re-init (needs a configure()-injected callback; tracked on #54). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -127,6 +127,11 @@ class MinstrelAudioHandler extends BaseAudioHandler with QueueHandler, SeekHandl
|
||||
String? _queueSource;
|
||||
String? get queueSource => _queueSource;
|
||||
|
||||
/// The full TrackRef list backing the current queue (even when only
|
||||
/// part is built as just_audio sources). Empty when nothing is
|
||||
/// queued. Exposed for resume-state persistence (#54).
|
||||
List<TrackRef> get queuedTracks => _lastTracks;
|
||||
|
||||
/// Volume stream for UI subscribers. Mirrors the just_audio player's
|
||||
/// volume directly; set via setVolume(double).
|
||||
Stream<double> get volumeStream => _player.volumeStream;
|
||||
|
||||
Reference in New Issue
Block a user