Closed maulaniad closed 1 year ago
@Mameng57
Remove the /landing and /login from the routes definition. If they are included there they won't resolve as part of onGenerateRoute
@etbrow Remove the /landing and /login from the routes definition. If they are included there they won't resolve as part of onGenerateRoute
You're right, i was confused . I thought both were required to do such operation, but in fact onGenerateRoute works like routes but with more customization.
api.flutter.dev onGenerateRoute Property
The route generator callback used when the app is navigated to a named route. ... This is used if routes does not contain the requested route.
While using the
Navigator.push(context, PageTransition(child: Widget(),),),
. it does work . but when using onGenerateRoutes, routes, and pushNamed it doesn't,here's my code :
here's how i called it :
Navigator.pushNamed(context, '/landing');
However it just plays the default transition with no effect.
Here's my project tree in case it's needed :
MaterialApp
sits at main.dart,onGenerateRoute
androutes
as well, i really don't know how to use it with named routes as i believe i already did what is being told on the Readme.