pushPageAndRemoveUntil<T extends Object?> method

Future<T?> pushPageAndRemoveUntil<T extends Object?>(
  1. RouteQuery newRoutePage,
  2. RoutePredicate predicate, [
  3. TransitionQuery? query
])

After returning to the page that matches the predicate condition, the user is redirected to the newRoutePage page.

If there is a RedirectQuery in newRoutePage and the condition is met, the user may be redirected to that page.

You can specify page transitions, etc. by giving query.

predicateの条件に合致するページに戻った後newRoutePageのページに遷移します。

newRoutePage内にRedirectQueryがあり条件に合致した場合、そのページに遷移する場合があります。

queryを与えることでページのトランジションなどを指定することができます。

Implementation

Future<T?> pushPageAndRemoveUntil<T extends Object?>(
  RouteQuery newRoutePage,
  RoutePredicate predicate, [
  TransitionQuery? query,
]) async {
  final route = newRoutePage.route<T>(query);
  return pushAndRemoveUntil<T>(
    route.createRoute(context),
    predicate,
  );
}