notifyPropertyChange<T> method
- @Deprecated('Use PropertyChangeNotifier')
- Symbol field,
- T oldValue,
- T newValue
inherited
Notify that the field name of this object has been changed.
The oldValue and newValue are also recorded. If the two values are
equal, no change will be recorded.
For convenience this returns newValue.
Deprecated
All Observable objects will no longer be required to emit change records
when any property changes. For example, ObservableList will only emit
on ObservableList.changes, instead of on ObservableList.listChanges.
If you are using a typed implements/extends Observable<C>, it is illegal
to call this method - will throw an UnsupportedError when called.
Implementation
@Deprecated('Use PropertyChangeNotifier')
T notifyPropertyChange<T>(
Symbol field,
T oldValue,
T newValue,
) {
if (hasObservers && oldValue != newValue) {
if (_isNotGeneric) {
notifyChange(
PropertyChangeRecord(
this,
field,
oldValue,
newValue,
) as C,
);
} else {
// Internal specific patch: Just do nothing.
//
// Generic typed Observable does not support.
}
}
return newValue;
}