pushNamed method

Future<void> pushNamed({
  1. required String name,
  2. Map<String, dynamic>? item,
  3. dynamic onPop()?,
  4. required BuildContext context,
})

Implementation

Future<void> pushNamed({
  required String name,
  Map<String, dynamic>? item,
  dynamic Function()? onPop,
  required BuildContext context,
}) async {
  if (_route != null) {
    _deliveringItem = item;
    pageQue.add(QueRoute(route: _route!.route!, type: lastNavigationType));
    lastNavigationType = NavigationType.push;
    await GoRouter.of(context).pushNamed(name);
    if (onPop != null) onPop();
  }
}