setStateListener method
(en) Adds a listener suitable for managing Undo and Redo. This listener will only notify when the value change is confirmed. For this reason, in batch processing, etc., notification will only be sent once at the end of the processing.
(ja) Undo, Redoの管理に適したリスナを追加します。 このリスナは、値の変更が確定した時のみ通知します。 このため、バッチ処理などでは処理の最後で1回だけ通知が行われます。
listener: A listener that is notified when the value changes.
Implementation
void setStateListener(StateListener? listener) {
_stateListener = listener;
}