0

I would like to group fields with default value if the JSON doesn't contain the key or if the value is null. Instead of putting @JsonKey(defaultValue: someValue) before every field is there any way to group fields by default value?

  final String? status;
  @JsonKey(defaultValue: 0)
  final num Curr;
  @JsonKey(defaultValue: 0)
  final num CurrR;
  @JsonKey(defaultValue: 0)
  final num CurrS;
  @JsonKey(defaultValue: 0)
  final num CurrT;
  @JsonKey(defaultValue: 0)
  final num Volt;
Soliev
  • 1,180
  • 1
  • 1
  • 12

0 Answers0