AppRouterDelegate constructor
AppRouterDelegate(
- HiRouter appRoutePath,
- Future<
RoutePageInfo> before(- RoutePageInfo pageInfo
- Widget defaultLoadingPage
Implementation
AppRouterDelegate(this.appRoutePath, this.before, this.defaultLoadingPage)
: navigatorKey = GlobalKey<NavigatorState>() {
appRoutePath.registerPushCallback((RoutePageInfo pageInfo) {
if (before != null) {
before!(pageInfo).then((newPageInfo) {
pushPageInfo = newPageInfo;
notifyListeners();
});
} else {
pushPageInfo = pageInfo;
notifyListeners();
}
});
}