getx icon indicating copy to clipboard operation
getx copied to clipboard

How to use GetMiddleware to stop route?

Open popopopdcvvbf opened this issue 1 year ago • 1 comments

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 !

popopopdcvvbf avatar Mar 10 '23 13:03 popopopdcvvbf

same issue, how to solve it ?

YeFei572 avatar Feb 05 '24 13:02 YeFei572

same issue

shang1219178163 avatar Jul 12 '24 00:07 shang1219178163