observe method
Attach a listener to the changes happening in the list.
You can choose to receive the change notification immediately (with fireImmediately)
or on the first change
Implementation
@override
Dispose observe(
Listener<ListChange<T>> listener, {
bool fireImmediately = false,
}) {
if (fireImmediately == true) {
final change = ListChange<T>(
list: this,
rangeChanges: <RangeChange<T>>[
RangeChange(index: 0, newValues: toList(growable: false)),
],
);
listener(change);
}
return _listeners.add(listener);
}