closeUntilLast method

  1. @override
void closeUntilLast(
  1. {Map<String, Object?>? resultMap}
)
override

Close the current top most location and every location after it until the last location is visible.

resultMap of String location path to Object as result for screen.

Implementation

@override
void closeUntilLast({Map<String, Object?>? resultMap}) {
  assert(_pages.isNotEmpty, "there's no page in the stack to close");

  if (_pages.length == 1) {
    return;
  }

  final Destination lastPageDestination = _pages.first.destination;

  closeUntil(location: lastPageDestination.path);
}