recordDrawingSnapshot method
void
recordDrawingSnapshot()
Records the current state of drawings to the undo stack.
Implementation
void recordDrawingSnapshot() {
_undoStack.add(_drawings.map((d) => d.copyWith()).toList());
if (_undoStack.length > _maxUndoHistory) {
_undoStack.removeAt(0);
}
_redoStack.clear();
}