Notify observers of a change.
For most objects Observable.notifyPropertyChange
is more convenient, but
collections sometimes deliver other types of changes such as a
ListChangeRecord
.
Notes:
- This is not required for fields if you mixin or extend Observable
,
but you can use it for computed properties.
- Unlike ChangeNotifier
this will not schedule deliverChanges
; use
Observable.dirtyCheck
instead.
void notifyChange(ChangeRecord record) {
if (!hasObservers) return;
if (_records == null) {
_records = [];
scheduleMicrotask(deliverChanges);
}
_records.add(record);
}