//This will probably be removed in future versions //you should call ExtendedNavigator.ofRouter<Router>() directly static ExtendedNavigatorState get navigator => ExtendedNavigator.ofRouter<AppRouter>();
@override Route<dynamic> onGenerateRoute(RouteSettings settings) { final args = settings.arguments; switch (settings.name) { case Routes.indexPageRoute: if (hasInvalidArgs<IndexPageArguments>(args)) { return misTypedArgsRoute<IndexPageArguments>(args); } final typedArgs = args as IndexPageArguments ?? IndexPageArguments(); return MaterialPageRoute<dynamic>( builder: (_) => IndexPage(key: typedArgs.key), settings: settings, ); case Routes.welcomePageRoute: if (hasInvalidArgs<WelcomePageArguments>(args)) { return misTypedArgsRoute<WelcomePageArguments>(args); } final typedArgs = args as WelcomePageArguments ?? WelcomePageArguments(); return MaterialPageRoute<dynamic>( builder: (_) => WelcomePage(key: typedArgs.key), settings: settings, ); case Routes.signInPageRoute: if (hasInvalidArgs<SignInPageArguments>(args)) { return misTypedArgsRoute<SignInPageArguments>(args); } final typedArgs = args as SignInPageArguments ?? SignInPageArguments(); return MaterialPageRoute<dynamic>( builder: (_) => SignInPage(key: typedArgs.key), settings: settings, ); case Routes.signUpPageRoute: if (hasInvalidArgs<SignUpPageArguments>(args)) { return misTypedArgsRoute<SignUpPageArguments>(args); } final typedArgs = args as SignUpPageArguments ?? SignUpPageArguments(); return MaterialPageRoute<dynamic>( builder: (_) => SignUpPage(key: typedArgs.key), settings: settings, ); case Routes.applicationPageRoute: if (hasInvalidArgs<ApplicationPageArguments>(args)) { return misTypedArgsRoute<ApplicationPageArguments>(args); } final typedArgs = args as ApplicationPageArguments ?? ApplicationPageArguments(); return MaterialPageRoute<dynamic>( builder: (_) => ApplicationPage(key: typedArgs.key), settings: settings, ); case Routes.detailsPageRoute: if (hasInvalidArgs<DetailsPageArguments>(args)) { return misTypedArgsRoute<DetailsPageArguments>(args); } final typedArgs = args as DetailsPageArguments ?? DetailsPageArguments(); return MaterialPageRoute<dynamic>( builder: (_) => DetailsPage(key: typedArgs.key), settings: settings, ); default: return unknownRoutePage(settings.name); } } }
Widget zoomInTransition(BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, Widget child) { // you get an animation object and a widget // make your own transition return ScaleTransition(scale: animation, child: child); }