containsRoute method
Implementation
Route? containsRoute({Route? route, RouteSettings? settings, String? name}){
if(route != null){
return routeHistory.contains(route) ? route : null;
}
if(settings != null){
try{
return routeHistory.firstWhere(
(element) => element.settings == settings,
);
} catch (e){
if(e is StateError){
return null;
}
}
}
if(name != null){
try{
return routeHistory.firstWhere(
(element) => element.settings.name == name,
);
} catch (e){
if(e is StateError){
return null;
}
}
}
return null;
}