state property
The value currently exposed by this notifier.
Invoking the setter will notify listeners if updateShouldNotify returns true.
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.
Warning:
Inside synchronous notifiers (Notifier
), reading state withing Notifier.build
may throw an exception if done before calling state=
.
Asynchronous notifiers (AsyncNotifier
) are not affected by this, as they
initialize their state to AsyncLoading
before calling Notifier.build
.
Warning:
Inside synchronous providers, reading state may throw if Notifier.build
threw.
Asynchronous notifiers will instead convert the error into an AsyncError
.
Implementation
@visibleForTesting
@protected
@override
AsyncValue<ValueT> get state;
Implementation
@visibleForTesting
@protected
@override
set state(AsyncValue<ValueT> newState);