offAll<T> method
Future<T?> ?
offAll<T>(
- Widget page(), {
- bool predicate(
- GetPage route
- bool opaque = true,
- bool? popGesture,
- String? id,
- String? routeName,
- Object? arguments,
- List<
Binding> bindings = const [], - bool fullscreenDialog = false,
- Transition? transition,
- Curve? curve,
- Duration? duration,
- bool showCupertinoParallax = true,
- double gestureWidth(
- BuildContext context
- CustomTransition? customTransition,
override
Implementation
@override
Future<T?>? offAll<T>(
Widget Function() page, {
bool Function(GetPage route)? predicate,
bool opaque = true,
bool? popGesture,
String? id,
String? routeName,
Object? arguments,
List<Binding> bindings = const [],
bool fullscreenDialog = false,
Transition? transition,
Curve? curve,
Duration? duration,
bool showCupertinoParallax = true,
double Function(BuildContext context)? gestureWidth,
CustomTransition? customTransition,
}) async {
// Names arriving from the context navigation extensions were cleaned
// with the legacy closure-only rule, so provided names are re-cleaned
// to also cover constructor tear-offs (#2245); explicit user names are
// untouched, since the pattern only matches runtimeType artifacts.
routeName = _cleanRouteName(routeName ?? "/${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,
customTransition: customTransition,
fullscreenDialog: fullscreenDialog,
bindings: bindings,
transitionDuration: duration ?? Get.defaultTransitionDuration,
);
final args = _buildPageSettings(routeName, arguments);
final newPredicate = predicate ?? (route) => false;
_pendingReplaceReport = true;
while (_activePages.length > 1 && !newPredicate(_activePages.last.route!)) {
_popWithResult();
}
return _replace(args, route);
}