clearTillFirstAndShowView<T> method

Future<T?>? clearTillFirstAndShowView<T>(
  1. Widget view, {
  2. dynamic arguments,
  3. int? id,
})

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);
}