abstract class ChangeNotifier


Mixin and base class for implementing an Observable object that performs its own change notifications, and does not need to be considered by Observable.dirtyCheck.

When a field, property, or indexable item is changed, a derived class should call notifyPropertyChange. See that method for an example.

Implements
  • Observable
Implemented by

Constructors

ChangeNotifier()

Properties

changes → Stream<List<ChangeRecord>>

read-only
hashCode → int

Get a hash code for this object.

read-only, inherited
hasObservers → bool

True if this object has any observers, and should call notifyPropertyChange for changes.

read-only
runtimeType → Type

A representation of the runtime type of the object.

read-only, inherited

Operators

operator ==(other) → bool

The equality operator.

inherited

Methods

deliverChanges() → bool

Synchronously deliver pending changes. Returns true if any records were delivered, otherwise false.

noSuchMethod(Invocation invocation) → dynamic

Invoked when a non-existent method or property is accessed.

inherited
notifyChange(ChangeRecord record) → void

Notify observers of a change.

notifyPropertyChange(Symbol field, Object oldValue, Object newValue) → dynamic

Notify that the field name of this object has been changed.

observed() → void

Override this method to be called when the changes are first observed.

toString() → String

Returns a string representation of this object.

inherited
unobserved() → void

Override this method to be called when the changes are no longer being observed.