Open MRezaKarimi opened 2 years ago
runApp(GetMaterialApp(
initialRoute: '/home',
defaultTransition: Transition.cupertino,
getPages: [
//Simple GetPage
GetPage(name: '/home', page: () => First()),
// GetPage with custom transitions and bindings
GetPage(
name: '/second',
page: () => Second(),
customTransition: SizeTransitions(),
binding: SampleBind(),
),
// GetPage with default transitions
GetPage(
name: '/third',
transition: Transition.cupertino,
page: () => Third(),
),
],
));
Forming your routes like this should fix the issue. This is specifically for Get named routes.
I added transitionDuration
, along with routes in getPages
and it starts working.
defaultTransition: Transition.circularReveal,
transitionDuration: const Duration(seconds: 1),
getPages: [...]
Provided solution fixed my issue when I removed the transition and transitionDuration from GetPage.
I set
defaultTransition: Transition.cupertino
in GetMaterialApp. When I change route using Get.to() it works fine; but when I use Get.toNamed() it not works anymore.here is my code:
Get version: 4.6.1 Flutter version: 2.8