clearHistory method

Future<void> clearHistory()

Clear navigation history.

Implementation

Future<void> clearHistory() async {
  _history.clear();
  _history = [];
  if (_canPersist && _enablePersistence) {
    await _persistSaver!(
      _rootContext,
      'MOMENTUM_ROUTER_HISTORY',
      jsonEncode(_history),
    );
  }
}