openPage<T> method
Future<T?> ?
openPage<T>(
- BuildContext context,
- String pageName, {
- RoutePushType pushType = RoutePushType.pushNamed,
- Map? arguments,
- RoutePredicate? predicate,
override
open page
Implementation
@override
Future<T?>? openPage<T>(BuildContext context, String pageName,
{RoutePushType pushType = RoutePushType.pushNamed,
Map<dynamic, dynamic>? arguments,
RoutePredicate? predicate}) {
if (!_routeInterceptorTable.containsKey(pageName)) {
return super.openPage(
context,
pageName,
pushType: pushType,
arguments: arguments,
predicate: predicate,
);
}
MixinRouteInterceptor interceptor = _routeInterceptorTable[pageName]!;
bool needIntercept = interceptor.call(
context,
pageName,
pushType,
arguments: arguments,
predicate: predicate,
);
if (needIntercept) {
return Future.value(null);
} else {
return super.openPage(
context,
pageName,
pushType: pushType,
arguments: arguments,
predicate: predicate,
);
}
}