state property

  1. @protected
  2. @visibleForTesting
State state
inherited

The value currently exposed by this Notifier.

If used inside Notifier.build, may throw if the notifier is not yet initialized.

Invoking the setter will notify listeners if updateShouldNotify returns true. By default, this will compare the previous and new value using identical.

Reading state if the provider is out of date (such as if one of its dependency has changed) will trigger Notifier.build to be re-executed.

If Notifier.build threw, reading state will rethrow the exception.

Implementation

@protected
@visibleForTesting
State get state {
  _element.flush();
  return _element.requireState;
}
  1. @protected
  2. @visibleForTesting
void state=(State value)
inherited

Implementation

@protected
@visibleForTesting
set state(State value) {
  // ignore: invalid_use_of_protected_member
  _element.setState(value);
}