We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Since Version 6.7.0 Records are supported.
If I am right, there is currently no possibility to set a default value for a field inside the record.
For example:
@JsonSerializable() class MyClass { final ({ double numberWithDefault, String someOtherText, }) myRecord; @JsonKey(defaultValue: 0.0) final double anotherNumberWithDefault; MyClass({ required this.myRecord, required this.anotherNumberWithDefault, }); factory MyClass.fromJson(Map<String, dynamic> json) => _$MyClassFromJson(json); Map<String, dynamic> toJson() => _$MyClassToJson(this); }
It would be nice to be able to set numberWithDefault to a default value, if the json value is null (just like anotherNumberWithDefault).
numberWithDefault
anotherNumberWithDefault
The text was updated successfully, but these errors were encountered:
toJson()
No branches or pull requests
Since Version 6.7.0 Records are supported.
If I am right, there is currently no possibility to set a default value for a field inside the record.
For example:
It would be nice to be able to set
numberWithDefault
to a default value, if the json value is null (just likeanotherNumberWithDefault
).The text was updated successfully, but these errors were encountered: