undo method

  1. @override
void undo()

Reverts the value on the stack to the previous value.


void undo() {
  if (_stack.currentValue == null)  {
    // Returns early if there is not a first value registered in the history.
    // This is important because, if an undo is received while the initial
    // value is being pushed (a.k.a when the field gets the focus but the
    // throttling delay is pending), the initial push should not be canceled.
  if (_throttleTimer?.isActive ?? false) {
    _throttleTimer?.cancel(); // Cancel ongoing push, if any.
  } else {