Skip to content

Commit

Permalink
Added comment about using AppStartupWidget to wrap ForceUpdateWidget
Browse files Browse the repository at this point in the history
  • Loading branch information
bizz84 committed Dec 19, 2024
1 parent 67b81e7 commit a828730
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/src/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ class MyApp extends ConsumerWidget {
return MaterialApp.router(
routerConfig: goRouter,
builder: (_, child) {
// * Important: Use AppStartupWidget to wrap ForceUpdateWidget otherwise you will get this error:
// * Navigator operation requested with a context that does not include a Navigator.
// * The context used to push or pop routes from the Navigator must be that of a widget that is a descendant of a Navigator widget.
return AppStartupWidget(
onLoaded: (_) => ForceUpdateWidget(
navigatorKey: goRouter.routerDelegate.navigatorKey,
Expand Down

0 comments on commit a828730

Please # to comment.