Navigator.of(context).replace<T>(oldRoute: oldRoute, newRoute: newRoute);
How to using this origin Flutter Api in Getx?
I am using the named routes in project like this :
GetPage(
name: Routes.SELECTTARGET,
page: () => TargetPage(),
binding: TargetBinding(),
fullscreenDialog: true)
Another problem:
I am trying using
Navigator.of(Get.context!).push(GetPageRoute(settings: RouteSettings(name: Routes.TARGETDETAIL, arguments: target.clone())));
But error occus:
Null check operator used on a null value
How to do
for navigating pages is like this:
Get.to(()=> Page()); // is same like to Navigator.push
Get.Off(()=> Page()); // is same like to Navigator.pushreplace something
for route Name :
Get.toName(RouteName.name); or Get.OfftoNamed(RouteName.name);
for more info try to read the documentation
https://github.com/jonataslaw/getx/blob/master/documentation/en_US/route_management.md
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With