undo method

void undo()

Implementation

void undo() {
  if (_undoStack.isNotEmpty) {
    final previousState = _undoStack.removeLast();
    _redoStack.add(state.copyWith());

    emit(previousState.copyWith(
      canUndo: _undoStack.isNotEmpty,
      canRedo: true,
      status: DiagramStatus.ready,
    ));
  }
}