addLocalHistoryEntry method

void addLocalHistoryEntry (LocalHistoryEntry entry)
inherited

Adds a local history entry to this route.

When asked to pop, if this route has any local history entries, this route will handle the pop internally by removing the most recently added local history entry.

The given local history entry must not already be part of another local history route.

Implementation

void addLocalHistoryEntry(LocalHistoryEntry entry) {
  assert(entry._owner == null);
  entry._owner = this;
  _localHistory ??= <LocalHistoryEntry>[];
  final bool wasEmpty = _localHistory.isEmpty;
  _localHistory.add(entry);
  if (wasEmpty)
    changedInternalState();
}