StateBloc<T> constructor

StateBloc<T>([
  1. T? initialValue
])

Implementation

StateBloc([T? initialValue]) {
  _stateStream = StateBlocStream<T>._(
    factory: _streamFactory,
  );
  _nonNullStream = _stateStream.whereType<T>();
  _stateChangeStream = StateBlocChangeStream<T>._(
    factory: _streamFactory,
  );

  if (initialValue != null) {
    add(initialValue);
  }
}