attach method

void attach()

Starts observing platform route information and navigation changes, reports the current state as a replacement entry, and optionally enables multi-entry history.

Implementation

void attach() {
  WidgetsBinding.instance.addObserver(this);
  if (useMultiEntryHistory)
    unawaited(SystemNavigator.selectMultiEntryHistory());
  _reportRouteInformation(navigation.state, replace: true);
  _subscription = navigation.stream.listen(_onRouteChanged);
}