setState method

  1. @protected
  2. @mustCallSuper
void setState([
  1. VoidCallback? callback
])

After the callback it produces the value. Notifies listeners only when value changes.

Implementation

@protected
@mustCallSuper
void setState([VoidCallback? callback]) async {
  callback?.call();
  final oldValue = _value;
  _value = build();

  if (oldValue != _value) {
    _notifier.notify();
  }
}