isFirst property

bool isFirst

Whether this route is the bottom-most route on the navigator.

If this is true, then Navigator.canPop will return false if this route's willHandlePopInternally returns false.

If isFirst and isCurrent are both true then this is the only route on the navigator (and isActive will also be true).


bool get isFirst {
  if (_navigator == null)
    return false;
  final _RouteEntry currentRouteEntry = _navigator._history.firstWhere(
    orElse: () => null,
  if (currentRouteEntry == null)
    return false;
  return currentRouteEntry.route == this;