setAnalyticsCollectionEnabled(kReleaseMode) after Firebase init so the native
SDK's automatic events (session_start, screen_view) stay out of production
analytics in debug too — not only our custom events. Verified on simulator:
release builds collect, debug builds do not.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
flutterfire configure registered the iOS/Android apps under project
block-seasons and generated firebase_options.dart + native config. main()
now initializes Firebase and routes analytics through FirebaseAnalyticsBackend
in release builds (console logger in debug, so dev traffic never pollutes
GA4). Firebase init is guarded — failure falls back to the debug logger
rather than blocking startup.
firebase.json keeps the existing Hosting config and gains the FlutterFire
platform section. Client config files are committed (they ship in the binary;
Firebase security is enforced by rules, not config secrecy).
flutter analyze clean, all 161 tests green.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adds firebase_core + firebase_analytics and a FirebaseAnalyticsBackend that
adapts the existing AnalyticsBackend interface to GA4. Kept in its own file
so the typed AnalyticsService and DebugAnalyticsBackend stay free of the
firebase dependency (unit tests never pull in platform channels).
Not yet wired into main() — that needs lib/firebase_options.dart from
flutterfire configure (owner step). All 161 tests still green.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
seasonsProvider now watches seasonRefreshProvider instead of relying on
a HomeScreen ref.listen, making the refresh ordering-independent. Removes
the redundant listener from HomeScreen. Appends *.pid to .gitignore.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Expose engine.rescueUsed getter and surface it through GameViewState so
the result overlay can omit the watch-ad FilledButton after a rescue has
been consumed, preventing a second tap from calling useContinue /
addExtraMoves and hitting their StateError guard. Give-up is promoted to
FilledButton when rescue is unavailable for clear affordance.
Also emit stageStart / endlessStart analytics in restart() so every
attempt (not just the first) is bracketed by a matching start event.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Prevents StateError when data builder is called with empty list
by displaying loading indicator instead of passing empty list to
activeSeason(), matching title screen behavior.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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>
Extends ContentRepository with optional cacheDir: cached packs in
<cacheDir>/seasons/*/pack.json merge with bundled ones (cached wins
for same id), corrupt/future-schema packs silently ignored, refresh()
fires ContentDownloader.sync() once per session. main() wires the real
cache+downloader instance; default constructor stays bundled-only for tests.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Wrap AnimatedBuilder in SizedBox.expand so the Stack fills the full
Scaffold body; alignment: Alignment.center now centers within the whole
screen instead of within the wordmark-sized intrinsic box.
Adds a regression widget test (test/ui/splash_screen_test.dart) that
asserts the wordmark dx is within 1px of screen-center at 1500ms into
the animation.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add SeasonFlowNotifier.clear() to null out the flow state
- Call clear() in HomeScreen's Classic button before startStage()
- Broaden tutorial-end guard to next.phase != GamePhase.playing (covers stuck)
- Add regression test: clear() resets flow to null
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add StageConfig.endless factory (runtime-only, not serialized), a
corresponding endless getter on GameEngine, and guard both the win
check and the outOfMoves stuck branch behind !_stage.endless so
endless runs can never be won or move-limited. Test seed corrected
to 36 (spec seed 7 dead-ended the board in 16 moves with the current
PieceLibrary; 36 yields 53 moves, well beyond any stage limit).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Guard addPostFrameCallback with !_autoScrolled so it only fires once per
widget lifetime instead of on every LayoutBuilder rebuild.
- Derive seasonComplete flag; pass it into _node so the last stage uses
gold "done" styling (not "current/next") when the season is fully 3-starred.
- Extract const Color(0xFF232B4A) to GamePalette.lockedNode.
- Remove warnIfMissed: false from tap call in season_map_screen_test; ensureVisible
already guarantees hit-testing succeeds (confirmed: test still passes cleanly).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces the plain GridView with a Candy-Crush-style journey map:
dotted serpentine path, circular nodes (gold=done, glowing=current,
dark+lock=locked), glass header, auto-scroll to current stage.
Updates season_map_screen_test to use Key('stage_node_$i') finders.
A finished stage ends the tutorial; otherwise the overlay would sit
on top of the result card and leak into the next stage.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add TutorialOverlay widget (dim veil, message bubble, animated hand on
dragPiece step, skip button) and wire it into game_screen: start on
flow.index==0 when tutorialDone is false, forward onPlaced/onLineCleared
events unconditionally from fxTick handler, and compute hand-path
coordinates from board/tray RenderBox geometry.
Shows "SEASON 1 / First Bloom / N stages" over the season background for
~1.6s between splash and home; tap anywhere skips. Bails to home on
content-load error. Adds seasonLabel/seasonStages l10n keys (en + ko).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add ValueKey(i) to each TweenAnimationBuilder in the star animation loop
to prevent Flutter from reusing widget state during rebuild cycles
- Add maxLines: 2 and overflow: TextOverflow.ellipsis to the almostThere
Text widget to prevent overflow in the loss-state progress message
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Stars on win now appear sequentially with elastic-bounce via
TweenAnimationBuilder (400/650/900 ms). Lost overlay shows a
CircularProgressIndicator ring with "87% complete!" (l10n:
almostThere) when objectiveProgress > 0.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
After Ticker.stop(), elapsed resets to zero on the next start(). _now was
left frozen at the old elapsed, so effects added after a drain captured a
stale start time and their progress() clamped to 0 forever — ticker never
stopped, second batch broken. Fix: reset _now = Duration.zero on drain.
Adds @visibleForTesting getters and a regression test that catches the
stale value directly.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fix 1: Stop allocating ThemeColors on every animation frame by caching it in
_colors field and updating only when theme changes via didUpdateWidget.
Fix 2: Leaf particles now follow the season accent color instead of hardcoded
orange, maintaining visual consistency with theme changes.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The shouldRepaint override was omitting flashRows and flashCols comparisons,
which could cause the painter to skip redraws when these lists changed.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Introduces candy-gloss tile rendering (diagonal gradient + glass highlight
+ optional glow) via a shared paintGlossyTile() in tile_painter.dart,
applied to board filled-cells and tray/drag-overlay pieces. Adds
ThemeColors to palette.dart for UI-layer season color resolution, and
activeThemeProvider for one-call access to the active season's theme.
Regenerates the game_screen golden to reflect the new look.
Pure advanceStreak (1-day grace none, milestone flags at 3/7/14/30),
persisted in the save blob; StreakNotifier advances on every finished
attempt; home screen flame chip and milestone snackbar. Fix flutter
create's camelCased iOS bundle id and underscored Android application
id to the agreed lowercase form before any store registration.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
SaveRepository (versioned JSON over prefs) with best-result merging and
unlock walking; ContentRepository loads the bundled pack; SeasonFlow/
Progress notifiers orchestrate stage start -> win record -> advance.
Season map grid with stars/locks, Home -> Map -> Game navigation,
close button, next-stage action on the win overlay.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Greedy bot with tray-survival lookahead and gem-line steering; generator
samples layouts along a difficulty curve, probes bot moves-to-win, sets
adaptive move budgets targeting win-rate bands, and derives star
thresholds from spare-move quantiles. Season 1 pack bundled in assets
with per-stage difficulty report.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Pure-Dart WAV synthesizer (tool/gen_sfx.dart) generates place/clear/
combo/win/lose effects; AudioService player pool fires on placement,
line clears, combo streaks, and phase transitions.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CustomPainter board with gems/ghost/clear-flash, finger-lifted drag
with snap preview, combo text effect, HUD chips, phase overlays with
rescue stubs, demo stage. E2E widget test drives a real drag gesture.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>