offAll<T> method

  1. @override
Future<T?>? offAll<T>(
  1. Widget page(), {
  2. bool predicate(
    1. GetPage route
    )?,
  3. bool opaque = true,
  4. bool? popGesture,
  5. int? id,
  6. String? routeName,
  7. dynamic arguments,
  8. List<BindingsInterface> bindings = const [],
  9. bool fullscreenDialog = false,
  10. Transition? transition,
  11. Curve? curve,
  12. Duration? duration,
  13. bool showCupertinoParallax = true,
  14. double gestureWidth(
    1. BuildContext context
    )?,
})
override

Implementation

@override
Future<T?>? offAll<T>(
  Widget Function() page, {
  bool Function(GetPage route)? predicate,
  bool opaque = true,
  bool? popGesture,
  int? id,
  String? routeName,
  dynamic arguments,
  List<BindingsInterface> bindings = const [],
  bool fullscreenDialog = false,
  Transition? transition,
  Curve? curve,
  Duration? duration,
  bool showCupertinoParallax = true,
  double Function(BuildContext context)? gestureWidth,
}) async {
  routeName = _cleanRouteName("/${page.runtimeType}");
  final route = GetPage<T>(
    name: routeName,
    opaque: opaque,
    page: page,
    gestureWidth: gestureWidth,
    showCupertinoParallax: showCupertinoParallax,
    popGesture: popGesture ?? Get.defaultPopGesture,
    transition: transition ?? Get.defaultTransition,
    curve: curve ?? Get.defaultTransitionCurve,
    fullscreenDialog: fullscreenDialog,
    bindings: bindings,
    transitionDuration: duration ?? Get.defaultTransitionDuration,
  );

  final args = _buildPageSettings(routeName, arguments);

  final newPredicate = predicate ?? (route) => false;

  while (_activePages.length > 1 && !newPredicate(_activePages.last.route!)) {
    _popWithResult();
  }

  return _replace(args, route);
}