emit method

void emit(
  1. {bool quiet = false}
)

Emits a change if the list has been modified since the last emit (or since it was initialized).

To emit a change but prevent a parent EmitterContainer from emitting a change, set quiet to true.

Implementation

void emit({bool quiet = false}) {
  assert(!isDisposed);
  if (_dirty && !quiet)
    addChangeToStream(emitDetailedChanges
        ? ListChange(List.from(_changes))
        : ListChange.any());
  else if (_dirty)
    addChangeToStream(emitDetailedChanges
        ? ListChange(_changes, quiet: true)
        : ListChange.any(quiet: true));
  _changes.clear();
  _dirty = false;
}