[firestore_serialize] Serialize Maps?
Opened this issue · 3 comments
ciriousjoker commented
Exception has occurred.
_TypeError (type '_InternalLinkedHashMap<String, dynamic>' is not a subtype of type 'Map<String, List<String>>')
This is the generated code:
selectedTags: data["selectedTags"]
It's just lacking a .cast<...>()
ciriousjoker commented
My workaround for now:
MyModel({
this.selfRef,
selectedTags,
}) {
this.selectedTags = (selectedTags as Map).cast<String, List<String>>();
}
lukas-h commented
The problem is that dart analyzer looses the type information of nested generic type annotations.
It’s a thing I wanted to investigate more in depth
lukas-h commented