navigate method

Future navigate(
  1. String targetNavigation,
  2. BuildContext? context,
  3. dynamic parameters
)

Use this method to go to a CupertinoStackView in the Cupertino StackView system.

Implementation

Future navigate(String targetNavigation, BuildContext? context, dynamic parameters) async {
  if (_isMapped(targetNavigation)) {
    while (_map.first._navigation != targetNavigation) {
      _navigatorState.currentState!.pop();
      _contexts.remove(currentNavigation);
      _map.removeAt(0);
      _organise();
      await Future.delayed(duration);
    }
  } else {
    _map.insert(0, _ListPair(targetNavigation, null));
    _contexts[targetNavigation] = context;
    _organise();
    showCupertinoModalPopup(
        context: context!,
        builder: (BuildContext context) {
          return Stack(
            children: [
              Container(
                constraints: BoxConstraints.expand(),
                color: Colors.transparent,
              ),
              _builders[targetNavigation]!(context, parameters),
            ],
          );
        });
  }
}