Asynchronous fromJson and toJson #1420
Labels
pkg:hydrated_bloc
This issue is related to the hydrated_bloc package
question
Further information is requested
wontfix
This will not be worked on
Projects
@saivarunr:
Greetings @felangel , hope you are healthy and safe. I would also like to thank you for the libraries you have provided to the community. I'm using bloc and hydrated bloc. I was thinking why not provide async support for both fromJson and toJson on the HydratedBloc (
hydrated_bloc/lib/src/hydrated_bloc.dart
Line 37 in 15eb68f
return _state = fromJson(Map<String, dynamic>.from(stateJson));
)
Describe the solution you'd like
I have this use case where we have to perform compute, validate checksum and then consider the input from local cache for further processing. At first, glance looks like it is not possible to invoke async methods/functions inside fromJson. If it cannot be implemented due to the underlying API, how do you suggest I should handle this problem on my side?
The text was updated successfully, but these errors were encountered: