GetNavigator constructor

GetNavigator({
  1. GlobalKey<NavigatorState>? key,
  2. bool onPopPage(
    1. Route,
    2. dynamic
    )?,
  3. required List<Page> pages,
  4. List<NavigatorObserver>? observers,
  5. bool reportsRouteUpdateToEngine = false,
  6. TransitionDelegate? transitionDelegate,
})

Implementation

GetNavigator({
  GlobalKey<NavigatorState>? key,
  bool Function(Route<dynamic>, dynamic)? onPopPage,
  required List<Page> pages,
  List<NavigatorObserver>? observers,
  bool reportsRouteUpdateToEngine = false,
  TransitionDelegate? transitionDelegate,
}) : super(
        //keys should be optional
        key: key,
        onPopPage: onPopPage ??
            (route, result) {
              final didPop = route.didPop(result);
              if (!didPop) {
                return false;
              }
              return true;
            },
        reportsRouteUpdateToEngine: reportsRouteUpdateToEngine,
        pages: pages,
        observers: [
          // GetObserver(),
          if (observers != null) ...observers,
        ],
        transitionDelegate:
            transitionDelegate ?? const DefaultTransitionDelegate<dynamic>(),
      );