pushAndRemoveUntil<T extends Object?> method

Future<T?> pushAndRemoveUntil<T extends Object?>(
  1. Widget widget, {
  2. PageRouteOptions options = const PageRouteOptions.material(),
  3. required RoutePredicate predicate,
})

Implementation

Future<T?> pushAndRemoveUntil<T extends Object?>(
  Widget widget, {
  PageRouteOptions options = const PageRouteOptions.material(),
  required RoutePredicate predicate,
}) {
  assert(FlExtended().navigatorKey.currentState != null,
      'Set FlExtended().navigatorKey to one of [MaterialApp CupertinoApp WidgetsApp]');
  return FlExtended()
      .navigatorKey
      .currentState!
      .pushAndRemoveUntil<T>(options.buildPageRoute(widget), predicate);
}