state property

  1. @protected
  2. @visibleForTesting
T get state
inherited

The current "state" of this StateNotifier.

Updating this variable will synchronously call all the listeners. Notifying the listeners is O(N) with N the number of listeners.

Updating the state will throw if at least one listener throws.

Implementation

@protected
@visibleForTesting
T get state {
  assert(_debugIsMounted(), '');
  return _state;
}
  1. @override
set state (T value)
override

Do not use the setter for state. Instead, use await update(value).

Implementation

@override
set state(T value) {
  assert(false,
      "Don't use the setter for state. Instead use `await update(value)`.");
  Future(() async {
    await update(value);
  });
}