nullable property

bool nullable
final

When true, null fields are handled gracefully when encoding to JSON and when decoding null and nonexistent values from JSON.

Setting to false eliminates null verification in the generated code for the annotated field, which reduces the code size. Errors may be thrown at runtime if null values are encountered, but the original class should also implement null runtime validation if it's critical.

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

Implementation

final bool nullable