toJson method
Responsible for converting a concrete instance of the bloc state
into the the Map<String, dynamic> representation.
If toJson returns null, then no state changes will be persisted.
Implementation
@override
Map<String, dynamic>? toJson(RequestState<T> state) {
if (state.status == RequestStatus.loaded)
return state.toJson(valueBuilder: valueToJson);
return null;
}