Closed woutervanwijk closed 2 years ago
I have the same issue. I am using auto_route package.
I had the same problem because I'm using Beamer to routing. I use navigatorKey: routerDelegate.navigatorKey to fix my error.
Widget build(BuildContext context) {
ScreenUtil.init();
return WiredashApp(
navigatorKey: routerDelegate.navigatorKey,
languageCode: "es",
child: MaterialApp.router(
debugShowCheckedModeBanner: false,
title: 'App',
theme: ThemeData(
primaryColor: AppColor.vulcan,
accentColor: AppColor.royalBlue,
scaffoldBackgroundColor: AppColor.vulcan,
visualDensity: VisualDensity.adaptivePlatformDensity,
textTheme: ThemeText.getTextTheme(),
appBarTheme: const AppBarTheme(elevation: 0),
),
routerDelegate: routerDelegate,
routeInformationParser: BeamerParser(),
backButtonDispatcher:
BeamerBackButtonDispatcher(delegate: routerDelegate),
),
);
}
routerDelegate
. Where does this value come from?
You need to provide your own implementation. Some references:
https://levelup.gitconnected.com/flutter-navigator-2-0-for-authentication-and-bootstrapping-part-2-user-interaction-5dc043e7e44a https://medium.com/geekculture/flutter-navigator-2-0-for-authentication-and-bootstrapping-part-5-web-eeb4835804df
my sample https://github.com/orestesgaolin/navigator_20_example
Old but maybe still helpful. Solved with:
final _appRouter = AppRouter();
...
child: Wiredash(
projectId: wireDashProjectId,
secret: wireDashSecret,
navigatorKey: _appRouter.navigatorKey,
child: MaterialApp.router(...
Please try the latest v1.0.0-alpha.4
release. The navigatorKey
is not required anymore.
The navigatorKey
has now been removed in stable release 1.0.0
I am not able to use Wiredash and the MaterialApp.router at the same time. Wiredash needs the navigatorKey, but MaterialApp.router doesn't use it