ChangeNotifier class mixin
A Listenable implementation that stores listeners and can notify them.
Subclasses (or mixins) call notifyListeners whenever their state changes.
- Implemented types
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addListener(
void listener()) → void -
Register
listenerto be called when the object notifies.override -
dispose(
) → void - Releases all listeners. After this call the notifier should not be used.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void - Notify all registered listeners.
-
removeListener(
void listener()) → void -
Remove a previously registered
listener.override -
throwIfDisposed(
) → void - Throws StateError if this notifier has already been disposed.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited