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
it use B.fromJson and C.fromJson to decode json and create instance for member B and C in class A which makes me must implement fromJson method in both B and C, why not use _$BFromJson and _$CFromJson to decode json and create instrance for both of them? just like following code
and these implemention only need me implement fromJson method in class A , and I do not need to modify class B and class C any more which make my life better.
The text was updated successfully, but these errors were encountered:
I have following complex model
When I use json_serializable to generate A.g.dart ,I got
everything is ok,but only one problem(maybe it is a problem just for me) is function _$AFromJson
it use B.fromJson and C.fromJson to decode json and create instance for member B and C in class A which makes me must implement fromJson method in both B and C, why not use _$BFromJson and _$CFromJson to decode json and create instrance for both of them? just like following code
and these implemention only need me implement fromJson method in class A , and I do not need to modify class B and class C any more which make my life better.
The text was updated successfully, but these errors were encountered: