push method

  1. @override
void push(
  1. Uri uri, [
  2. Object? state
])
override

Pushes a new history entry.

The optional state is stored on the entry and can be read back via location's RouteInformation.state.

Implementation

@override
void push(Uri uri, [Object? state]) {
  action = .push;
  index += 1;
  _entries
    ..length = index
    ..add(
      _MemoryEntry(
        info: RouteInformation(uri: uri, state: state),
        identifier: generateIdentifier(),
      ),
    );
}