Commit Graph

8 Commits

Author SHA1 Message Date
Roland Geider
554a54e31b Finish the material_ui migration 2026-09-26 22:38:40 +02:00
pankaj-basnet
5ab92f73cb test: align test imports for material_ui package usage 2026-09-01 21:30:57 +05:45
pankaj-basnet
f7930ce68b fix: remove material_ui imports where not needed 2026-09-01 21:12:14 +05:45
pankaj-basnet
fee0079dc9 material ui: post-flutter-3.47 imports, dart fix applied 2026-09-01 21:08:51 +05:45
Ben Tucker
fe33f693a8 fix(core): make UI side effects and provider reads safe during build
Errors handled while the widget tree is building crashed or wedged the
app in three related ways:

- FlutterError.onError showed dialogs and snackbars synchronously.
  Pushing a route mid-build trips the navigator's !_debugLocked
  assertion, and because the one-dialog guard was set before showDialog
  threw, its release never attached: every later error dialog was then
  silently suppressed while nothing was on screen, leaving a blank,
  unresponsive app until restart. Snackbars crashed outright via the
  messenger's setState.
- The sync status and barcode dialogs did ref.read inside their route
  builders, which run during build. With the provider chain dirty (any
  token refresh dirties wgerBase -> auth), the read flushed it there and
  Riverpod scheduled a scope refresh mid-build. The barcode builder also
  created its search future inline, re-firing the search on every dialog
  rebuild.
- Provider create bodies that widgets watch during build read providers
  synchronously: the dashboard's routine hydration chain crashed on cold
  start right after a token refresh, and TrophyStateNotifier.build()
  has the same shape in the post-login window, where invalidation order
  left networkStatusProvider dirty while its dependents rebuilt.

lib/core/build_safety.dart adds the two idioms as helpers: runAfterFrame
defers UI side effects past the build phase, yieldPastBuild yields
provider create bodies past their synchronous phase (a microtask, not a
timer, since widget tests assert !timersPending at teardown). The error
dialog guard is released when the context is gone or the push fails, the
snackbar helpers re-resolve the messenger inside the callback, the
dialog builders snapshot their providers in the tap handler, and
post-login invalidation runs leaf-first. Regression tests cover each
shape.
2026-08-16 17:29:43 -05:00
Roland Geider
60c9f67282 Move shared infra to lib/core/ 2026-07-01 20:28:06 +02:00
Roland Geider
bfb44c2157 Extract title from html error messages 2026-06-17 21:39:51 +02:00
Roland Geider
57947eabe6 Don't default to black text
Otherwise this might be unreadable on dark mode
2026-06-05 14:47:36 +02:00