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,
})

Implementation

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