converters property Null safety

List<JsonConverter>? converters
@JsonKey(includeFromJson: false, includeToJson: false)final

A list of JsonConverter to apply to this class.


@JsonSerializable(converters: [MyJsonConverter()])
class Example {...}

is equivalent to writing:

class Example {...}

The main difference is that this allows reusing a custom JsonSerializable over multiple classes:

const myCustomAnnotation = JsonSerializable(
  converters: [MyJsonConverter()],

class Example {...}

class Another {...}


@JsonKey(includeFromJson: false, includeToJson: false)
final List<JsonConverter>? converters;