From a828730e31078887c5837792bc6c86ae106a2c55 Mon Sep 17 00:00:00 2001 From: Andrea Bizzotto Date: Thu, 19 Dec 2024 09:42:46 +0000 Subject: [PATCH] Added comment about using AppStartupWidget to wrap ForceUpdateWidget --- lib/src/app.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/src/app.dart b/lib/src/app.dart index 4d65c54..2f89ca3 100644 --- a/lib/src/app.dart +++ b/lib/src/app.dart @@ -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,