isFirst property

bool isFirst
inherited

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).

Implementation

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