clearTillFirstAndShow<T> method
Pops the navigation stack until there's 1 view left then pushes routeName
onto the stack
id
is for when you are using nested navigation, as explained in documentation.
preventDuplicates
will prevent you from pushing a route that you already in, if you want to push anyway,
set to false.
Implementation
Future<T?>? clearTillFirstAndShow<T>(
String routeName, {
dynamic arguments,
int? id,
bool preventDuplicates = true,
Map<String, String>? parameters,
}) {
_clearBackstackTillFirst();
return navigateTo<T?>(
routeName,
arguments: arguments,
id: id,
preventDuplicates: preventDuplicates,
parameters: parameters,
);
}