New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: Serialization/Deserializaton with Map<String, dynamic> #887
Comments
Hey I am facing the same situation. Firebase APIs returns Map with list of key and value. BuiltValue cant parse it. The error returned is : Unhandled Exception: type 'BuiltMapSerializer' is not a subtype of type 'Serializer<BuiltMap<String, BuiltProduct>>'. Any solution you got? |
I asked at stackoverflow and received this answer. Hope it helps. |
Hi @JRamos29, Did you succeed to implement the solution ? I tried the following without success: Map<String, dynamic> toFirestore() {
return serializers.serializeWith(Place.serializer, this);
}
static Place fromFirestore(Map<String, dynamic> json) {
return serializers.deserializeWith(Place.serializer, json);
}
|
Hi @binajmen. The only possible solution I have is the one linked above. |
Hi,
i'm trying to use built_value, but i can't figure it out how to make the methods toJson() and fromJson() transforms and receives a Map<String, dynamic> instead of String. I used a snippet to create my classes, and don't know what changes i need to make to achieve the serialization with Map<String, dynamic>. I need to use with Firestore and the method setData only accepts map. This is my current serializer:
And here are the methods:
The text was updated successfully, but these errors were encountered: