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
When using a default value instanciation, the build() method of the builder adds an unecessary "!", which may leads to a throw.
For instance with this class :
@JsonSerializable()
@DataClass(changeable: true, buildable: true)
class IbpMeasure extends WithArea with _$IbpMeasure {
const IbpMeasure({
required this.method,
this.comments,
String? version,
}) : version = version ?? '3_0';
factory IbpMeasure.fromJson(JsonObject json) => _$IbpMeasureFromJson(json);
JsonObject toJson() => _$IbpMeasureToJson(this);
final IbpMethod method;
final String? comments;
final String version;
}
When using a default value instanciation, the build() method of the builder adds an unecessary "!", which may leads to a throw.
For instance with this class :
The generated builder is :
But for the
version
field, the "!" should be present at all, because in the constructor it's nullable.The text was updated successfully, but these errors were encountered: