We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi. Im new to AutoRoute, I cant figure out how to make more pages with this boilerplate. So I made something liek this.
@AdaptiveAutoRouter( replaceInRouteName: 'Page,Route', routes: <AutoRoute>[ //RedirectRoute(path: '*', redirectTo: '/'), AutoRoute(page: AppStartPage, initial: true), AutoRoute( path: '/home', page: HomePage, children: <AutoRoute>[ AutoRoute<FieldInfoPage>( name: 'FieldInfoRoute', path: 'fieldInfo', page: FieldInfoPage, ), ], ), signInRouter, signUpRouter, ], )
But the problem here is that after flutters "hot reload" it triggers the AppStartPage, and opens the HomePage again.
How do I make it so it doesn't open HomePage everytime it reloads?
The text was updated successfully, but these errors were encountered:
I got it. After hours of seraching. The App Widget needs to be StatefulWidget for the hot-reload to work properly.
class App extends StatefulWidget { const App({super.key}); @override State<App> createState() => _AppState(); } class _AppState extends State<App> { final _appRouter = AppRouter(); @override Widget build(BuildContext context) { return MaterialApp.router( theme: ThemeData( appBarTheme: const AppBarTheme(color: Color.blue), colorScheme: ColorScheme.fromSwatch(accentColor: Color.blue), // fontFamily: 'Roboto', ), routerDelegate: AutoRouterDelegate( _appRouter, navigatorObservers: () => [AppRouteObserver()], ), routeInformationProvider: _appRouter.routeInfoProvider(), routeInformationParser: _appRouter.defaultRouteParser(), localizationsDelegates: const [ AppLocalizations.delegate, GlobalMaterialLocalizations.delegate, ], useInheritedMediaQuery: true, supportedLocales: AppLocalizations.supportedLocales, builder: (BuildContext context, Widget? child) { final data = MediaQuery.of(context); return MediaQuery( data: data.copyWith( textScaleFactor: 1, ), child: child!, ); }, ); } }
Sorry, something went wrong.
No branches or pull requests
Hi. Im new to AutoRoute, I cant figure out how to make more pages with this boilerplate.
So I made something liek this.
But the problem here is that after flutters "hot reload" it triggers the AppStartPage, and opens the HomePage again.
How do I make it so it doesn't open HomePage everytime it reloads?
The text was updated successfully, but these errors were encountered: