BidirectionalHydratedBloc<E extends BlocEvent, S extends HydratedBlocState> constructor

BidirectionalHydratedBloc<E extends BlocEvent, S extends HydratedBlocState>({
  1. required BlocStore<S> store,
  2. required String persitenceKey,
  3. BlocStateBuilder<S>? initialStateBuilder,
  4. S? initialState,
  5. int eventStateHistorySize = 50,
  6. bool enableForceBuildEvents = false,
})

Implementation

BidirectionalHydratedBloc({
  required this.store,
  required this.persitenceKey,
  super.initialStateBuilder,
  super.initialState,
  super.eventStateHistorySize = 50,
  super.enableForceBuildEvents = false,
}) {
  subxList.add(onData.listen((S state) {
    Stream.fromFuture(store.persist(persitenceKey, state));
  }));
}