notifyChange method Null safety

  1. @override
void notifyChange(
  1. [C? change]
)
override

Schedules change to be delivered.

If change is omitted then ChangeRecord.any will be sent.

If there are no listeners to changes, this method does nothing.

Implementation

@override
void notifyChange([C? change]) {
  if (!hasObservers) {
    return;
  }
  if (change != null) {
    (_queue ??= <C>[]).add(change);
  }
  if (!_scheduled) {
    scheduleMicrotask(deliverChanges);
    _scheduled = true;
  }
}