Fixes TextEditingController used after being disposed the controller
was being manually disposed while the dialog's TextField still held a
reference during the pop animation. Now the dialog is its own
StatefulWidget so dispose() is called automatically by the framework
at the right time.
Eliminates all _dependents.isEmpty and Duplicate GlobalKeys crashes by
routing every dialog through a global NavigatorState key and every
snackbar through a global ScaffoldMessengerState key. These keys live
on MaterialApp and are never disposed, so async operations can safely
show UI feedback regardless of widget tree rebuilds from auth events.
The AddCarDialog now pops with a boolean result instead of trying to
show a SnackBar on its own context after Navigator.pop() disposes it.
HomeScreen shows the snackbar using its own stable mounted context.
Prevents Duplicate GlobalKeys / wrong build scope crashes when opening
dialogs from async scanner and DB operations. The scan button is also
disabled while a query is in flight to prevent double-taps.
- AuthGate now tracks wasLoggedIn vs isLoggedIn and only calls setState
when the login status actually flips, preventing token-refresh events
from tearing down open dialogs and causing _dependents.isEmpty crashes
- Fix TextEditingController disposal order in scanner manual entry dialog
Same _dependents.isEmpty crash as the password dialog the Add/Already
Exists dialogs were sharing the parent context across async DB calls.
Now each dialog is an independent widget with its own lifecycle.
Fixes red screen crash ('_dependents.isEmpty is not true') caused by
auth state change rebuilding the widget tree while the dialog was
still open and sharing the parent context across an async gap.
- Add camera, google_mlkit_text_recognition, image_picker, permission_handler deps
- Create ScannerScreen with live camera preview and OCR text recognition
- Auto-detect Hot Wheels IDs (e.g. JKF21) from captured photos using regex
- Add manual entry fallback dialog for typing HW ID by hand
- Update HomeScreen with scan FAB button and full DB query flow
- Query hotwheels table with .eq('hw_id', scannedCode).maybeSingle()
- Show 'Already in Collection' alert if car exists
- Show 'Add to Collection?' confirmation with insert if car is new
- Add supabase_flutter dependency
- Replace default counter template with auth flow (AuthGate, LoginScreen, HomeScreen)
- Implement email/password sign-in via signInWithPassword()
- Add forgot password flow with resetPasswordForEmail() and hwcollector://login deep link
- Handle PASSWORD_RECOVERY event to show set-new-password dialog
- Add deep link intent-filter to AndroidManifest for hwcollector://login scheme
- Configure Supabase URL and publishable key
- Replace outdated widget test with placeholder