isFirst property

bool isFirst

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

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!._firstRouteEntryWhereOrNull(_RouteEntry.isPresentPredicate);
  if (currentRouteEntry == null) {
    return false;
  }
  return currentRouteEntry.route == this;
}