saveState method

  1. @protected
  2. @mustCallSuper
void saveState()
inherited

Implementation

@protected
@mustCallSuper
void saveState() {
  final state = (encode ?? jsonEncode)(_data);
  if (_index >= 0 && _index < history.length && history[_index] == state) return;
  if (_index < history.length - 1) history.removeRange(_index + 1, history.length);
  history.add(state);
  _index++;
  _trimToCapacity();
  _updateFlags();
}