handlePopupRoutes method

Future<bool> handlePopupRoutes({
  1. Object? result,
})

Implementation

Future<bool> handlePopupRoutes({
  Object? result,
}) async {
  Route? currentRoute;
  navigatorKey.currentState!.popUntil((Route route) {
    currentRoute = route;
    return true;
  });
  if (currentRoute is PopupRoute) {
    return navigatorKey.currentState!.maybePop(result);
  }
  return false;
}