handlePopupRoutes method

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

Implementation

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