replaceRoute method

dynamic replaceRoute(
  1. Route? newRoute,
  2. Route? oldRoute
)

Implementation

replaceRoute(Route? newRoute, Route? oldRoute) {
  _map.removeWhere((key, value) => key == oldRoute);
  _routeQueue =
      Queue.from(_routeQueue.map((e) => e == oldRoute ? newRoute : e));
}