StreamBloc<State, StreamType extends Object?> constructor

StreamBloc<State, StreamType extends Object?>(
  1. State initial
)
  • Contains implementation for single subscription streams
  • StreamType - the return type of the stream

Implementation

StreamBloc(State initial) : super(initial) {
  on<OnStreamData<StreamType>>((event, emit) async {
    await onStreamData(event.streamData, emit);
  });
  on<OnStreamError>((event, emit) async {
    await onStreamError(event.error, event.stackTrace, emit);
  });
  initialise();
}