saveStateToHistory method

void saveStateToHistory()

Pushes current state to undo history.

Implementation

void saveStateToHistory() {
  _undoStack.add(_value);
  if (_undoStack.length > 100) _undoStack.removeAt(0);
  _redoStack.clear();
}