Files
swiftcontrol/lib/pages/onboarding
Jonas Bark 2c7b18f410 fix(paywall): "Go Pro" from the trainer picker opens instead of crashing
The onboarding trainer picker passed the State's own context into
connectTrainerFromPicker. Its trial gate opens the Go Pro dialog, whose
purchase action opens the paywall drawer -- and that context sits above
the Scaffold's DrawerOverlay, so openDrawer's `parentLayer!` threw. In
release the user saw only a "Null check operator used on a null value"
toast and the paywall never appeared, which on an expired trial leaves
no way forward at all.

Pass _sheetContext, which lives below the Scaffold.

_showPaywall also stops depending on callers getting that right: with no
DrawerOverlay ancestor it now falls back to showDialog, which only needs
a Navigator. The paywall already constrains and scrolls itself, so it
renders correctly either way. The paywall is the last thing that should
break when a caller passes the wrong context.

Symbolized from a support bundle (chat 197d1f1a, Windows 6.4.3 patch 13):
four identical traces seconds apart, each on the Go Pro tap.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-19 22:13:47 +02:00
..