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
Except that the generated message.g.dart (by running $ flutter pub run build_runner build) doesn't automatically call that toJson() method (which to me seems strange):
Why doesn't the
json_serializable
package automatically calltoJson()
for child objects?For example, in
message.dart
, I've got:And that
User
object is also@JsonSerializable()
as seen inuser.dart
:Except that the generated
message.g.dart
(by running$ flutter pub run build_runner build
) doesn't automatically call thattoJson()
method (which to me seems strange):Any suggestions (besides manually editing the
_$MessageToJson
method)?The text was updated successfully, but these errors were encountered: