BerryFlavor.fromJson constructor

BerryFlavor.fromJson(
  1. Map<String, dynamic> json
)

Implementation

BerryFlavor.fromJson(Map<String, dynamic> json) {
  id = json['id'];
  name = json['name'];
  if (json['berries'] != null) {
    berries =  <Berries>[];
    json['berries'].forEach((v) {
      berries!.add( Berries.fromJson(v));
    });
  }
  contestType = json['contest_type'] != null
      ?  NamedAPIResource.fromJson(json['contest_type'])
      : null;
  if (json['names'] != null) {
    names =  <Names>[];
    json['names'].forEach((v) {
      names!.add( Names.fromJson(v));
    });
  }
}