clearTillFirstAndShowView<T> method
Pops the navigation stack until there's 1 view left then pushes view
onto the stack
id
is for when you are using nested navigation, as explained in documentation.
Implementation
Future<T?>? clearTillFirstAndShowView<T>(Widget view,
{dynamic arguments, int? id}) {
_clearBackstackTillFirst();
return navigateToView<T?>(view, arguments: arguments, id: id);
}