redo method
- T currentState
Redoes the last undone command.
Implementation
T? redo(T currentState) {
if (!canRedo) return null;
final command = _redoStack.last;
final next = command.redo(currentState);
_redoStack.removeLast();
_undoStack.add(command);
return next;
}