offAll method
Future<T?> ?
offAll(
- Widget page(), {
- bool predicate(
- GetPage route
- bool opaque = true,
- bool? popGesture,
- String? id,
- String? routeName,
- Object? arguments,
- List<
BindingsInterface> bindings = const <BindingsInterface>[], - bool fullscreenDialog = false,
- Transition? transition,
- Curve? curve,
- Duration? duration,
- bool showCupertinoParallax = true,
- double gestureWidth(
- BuildContext context
override
Navigates off all pages and returns a result of type T
.
Implementation
@override
Future<T?>? offAll(
Widget Function() page, {
bool Function(GetPage route)? predicate,
bool opaque = true,
bool? popGesture,
String? id,
String? routeName,
Object? arguments,
List<BindingsInterface> bindings = const <BindingsInterface>[],
bool fullscreenDialog = false,
Transition? transition,
Curve? curve,
Duration? duration,
bool showCupertinoParallax = true,
double Function(BuildContext context)? gestureWidth,
}) async {
routeName = cleanRouteName("/${page.runtimeType}");
final GetPage<T> 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 PageSettings args = _buildPageSettings(routeName, arguments);
final bool Function(GetPage route) newPredicate =
predicate ?? (GetPage route) => false;
while (_activePages.length > 1 && !newPredicate(_activePages.last.route!)) {
_popWithResult();
}
return _replace(args, route);
}