StateNotifier<S> class

Inheritance
  • Object
  • BaseNotifier<S>
  • StateNotifier
Mixed-in types
  • ListeneableNotifier<S>

Constructors

StateNotifier(S initialState)

Properties

disposed bool
Tell us if the notifier was disposed
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
returns true when the current notifier has subscribers
no setterinherited
mounted bool
Tell us if the notifier is mounted
no setterinherited
oldState → S
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state ↔ S
Updates the State and notify to listeners and rebuild the widgets
getter/setter pair

Methods

addListener(ListenerCallback<S> listener) → void
add a new listener
inherited
clearListeners() Future<void>
inherited
dispose() FutureOr<void>
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners(S data) → void
notify to listeners and rebuild the widgets
inherited
onlyUpdate(S newState) → void
updates the state but does not notify to the listeners
onStateChanged(S oldState, S currentState) → void
this method is called when the state has been changed
onStateWillChange(S oldState, S newState) bool
this method is called when the state is going to be updated By default this method returns true, you can use this method to intercept the newState and check if the new state is valid. If this method returns false the new state will be igonored
removeListener(ListenerCallback<S> listener, {bool ignoreAutoDispose = false}) → void
remove a listener from the notifier
inherited
setDisposableCallback(void disposableCallback()) → void
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited