shouldInsertValueIntoQueue method

  1. @protected
bool shouldInsertValueIntoQueue(
  1. ScribbleState newValue,
  2. ScribbleState lastInQueue
)
inherited

You can override this function if you want to filter certain values before adding them to the history.

By default, this uses value equality, but you could for example always return true in case your value doesn't support value equality. newValue holds the value that's supposed to be added, lastInQueue is the value that's currently last in the undo queue.

Implementation

@protected
bool shouldInsertValueIntoQueue(T newValue, T lastInQueue) {
  return newValue != lastInQueue;
}