getx
getx copied to clipboard
How to use GetMiddleware to stop route?
I have a Verify the password page,and when I submit the right password ,it will run a function from last page. like:
Get.toNamed(GetTest1Page.name, arguments: () {
Get.toNamed(GetTest3Page.name);
});
And the GetTest2Page is the Verify the password page. I want do it If the password has been entered within the last half hour,then don't need to enter password again ,and go to the GetTest3Page。
Like this:
RouteSettings? redirect(String? route) {
var func = Get.arguments ?? () {};
if (func is Function) {
func.call();
}
return null;
}
But how I stop the current route, do not go to GetTest2Page then to GetTest3Page?
I try like this, but it throw a error
@override
GetPage? onPageCalled(GetPage? page) {
return null;
}
what should I do ? Please help me !
same issue, how to solve it ?
same issue