diff --git a/lib/router.dart b/lib/router.dart index e5b6269..ecc7f2c 100644 --- a/lib/router.dart +++ b/lib/router.dart @@ -407,4 +407,10 @@ final appRouter = GoRouter( ), ), ], + onException: (context, state, router) { + if (state.error is GoException) { + router.goNamed('/'); + } + }, + navigatorKey: GlobalKey(), );