I'm using Freezed to generate my models. I want to ignore a specific key, so I'm using @JsonKey(ignore: true).
@freezed
class ObjectA with _$ObjectA {
const factory ObjectA({
@JsonKey(ignore: true)
List<ObjectB> ObjectBList,
}) = _ObjectA;
factory ObjectA.fromJson(Map<String, dynamic> json) => _$ObjectA(json);
}
When I try to run the build_runner, I'm getting the above exception:
The parameter
ObjectBList
ofObjectA.
is non-nullable but is neither required nor marked with @Default
Why doesn't it been ignored?