streamOfCollection method

Stream streamOfCollection(
  1. List<Type> events
)

Return dart stream of events with particular names

events - list of events to receive

Implementation

Stream streamOfCollection(List<Type> events) {
  if (_isDisposed) {
    throw const IllegalStateException(
      message: 'Can\'t call streamOfCollection after dispose.',
    );
  }

  return _streamController.stream.where(
    (event) => events.contains(event.runtimeType),
  );
}