includeIfNull property

bool? includeIfNull
final

Specifies whether fields with null values should be included in the serialized output.

If true, the field will be included in the serialized output even if its value is null.

The default value, null, indicates that the behavior should be acquired from the JsonSerializable.includeIfNull annotation on the enclosing class.

If disallowNullValue is true, this value is treated as false to ensure compatibility between toJson and fromJson.

If both includeIfNull and disallowNullValue are set to true on the same field, an exception will be thrown during code generation.

Implementation

final bool? includeIfNull;