redo method

void redo()

Redoes the last undone action. The redo operation can be undone.

If canRedo is false, nothing happens and notifyListeners is not called.

Calling this will notify all the listeners of this PainterController that they need to update (it calls notifyListeners). For this reason, this method should only be called between frames, e.g. in response to user actions, not during the build, layout, or paint phases.

Implementation

void redo() {
  if (!canRedo) return;
  final action = unperformedActions.removeLast();
  action.perform(this);
  performedActions.add(action);
}