You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The generated code will have whereGender, orderByGender and other Gender related things, like _$MalePerFieldToJson.gender(...) but the _$MalePerFieldToJson class doesn't have gender getter in it.
Possible fixes:
As toJson and fromJson are only generated for id and i fields and not the gender field. The cloud_firestore_odm should also not generate anything for gender.
// `gender` is not generated.Male_$MaleFromJson(Map<String, dynamic> json) =>Male(
id: (json['id'] asnum).toInt(),
i: (json['i'] asnum).toInt(),
);
// `gender` is not generatedMap<String, dynamic> _$MaleToJson(Male instance) =><String, dynamic>{
'id': instance.id,
'i': instance.i,
};
Or, the generated class _$MalePerFieldToJson should also include the gender property.
@rrousselGit Sorry, I accidentally pressed "return" and the empty template was published. Could you please look into it now?
Thanks Rémi
iLoveDocs
changed the title
[cloud_firestore_odm
[cloud_firestore_odm] Either don't generate code for fields passed in super call or generate code for PerFieldToJson
Jul 26, 2024
Minimal reproducible code
dart run build_runner build -d
.whereGender
,orderByGender
and otherGender
related things, like_$MalePerFieldToJson.gender(...)
but the_$MalePerFieldToJson
class doesn't havegender
getter in it.Possible fixes:
toJson
andfromJson
are only generated forid
andi
fields and not thegender
field. Thecloud_firestore_odm
should also not generate anything forgender
._$MalePerFieldToJson
should also include thegender
property.Specifications
The text was updated successfully, but these errors were encountered: