withReleaseControl method
Return ModuleRoute with ReleaseGuard.
without guardedRoute
default value is routerName
of ModuleRoute
Implementation
ModularRoute withReleaseControl({String? guardedRoute, String? redirectTo}) {
final _guardedRoute = guardedRoute ?? Modular.to.path;
final _guards = List<RouteGuard>.from(middlewares);
if (kReleaseMode) {
_guards.add(ReleaseGuard(_guardedRoute, redirectTo: redirectTo));
}
return copyWith(middlewares: _guards);
}