feat: session content sync trigger and newest-season selection
Add seasonRefreshProvider (once-per-session FutureProvider) and activeSeason() helper; HomeScreen listens and invalidates seasonsProvider when new packs arrive; season_map_screen and season_title_screen switch from list.first to activeSeason. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -44,6 +44,16 @@ final seasonsProvider = FutureProvider<List<SeasonPack>>(
|
||||
(ref) => ref.read(contentRepositoryProvider).availableSeasons(),
|
||||
);
|
||||
|
||||
/// One background content sync per app session. Home listens and refreshes
|
||||
/// the season list when new packs arrived.
|
||||
final seasonRefreshProvider = FutureProvider<bool>(
|
||||
(ref) => ref.read(contentRepositoryProvider).refresh(),
|
||||
);
|
||||
|
||||
/// The season players land in by default: the newest available.
|
||||
/// (availableSeasons is sorted by seasonId ascending.)
|
||||
SeasonPack activeSeason(List<SeasonPack> seasons) => seasons.last;
|
||||
|
||||
final streakProvider = NotifierProvider<StreakNotifier, StreakState>(
|
||||
StreakNotifier.new,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user