push method

  1. @override
void push(
  1. Uri uri, {
  2. Object? state,
})
override

Pushes a new history entry.

Implementation

@override
void push(Uri uri, {Object? state}) {
  action = .push;
  index = (this.state?.index ?? 0) + 1;
  final historyState = HistoryState(
    userData: state,
    index: index ?? 0,
    identifier: generateIdentifier(),
  );

  window.history.pushState(
    historyState.toJson().jsify(),
    '',
    createHref(uri),
  );
}