HydratedBloc

constructor(initialState: S, serializer: KSerializer<S>, storageKeyParam: String? = null, storage: HydratedStorage = HydratedBloc.storage)

Parameters

initialState

Fallback used when no persisted data is found.

serializer

kotlinx.serialization serializer for S. Use MyState.serializer() (generated by the @Serializable annotation).

storage

Storage backend. Defaults to HydratedBloc.storage.

Type Parameters

S

State type — must be annotated with @Serializable.

E

Event type.