ItemCategory.fromJson constructor

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

Implementation

ItemCategory.fromJson(Map<String, dynamic> json) {
  id = json['id'];
  name = json['name'];
  if (json['items'] != null) {
    items = new List<NamedAPIResource>();
    json['items'].forEach((v) {
      items.add(new NamedAPIResource.fromJson(v));
    });
  }
  if (json['names'] != null) {
    names = new List<NamedAPIResource>();
    json['names'].forEach((v) {
      v = v['language'];
      names.add(new NamedAPIResource.fromJson(v));
    });
  }
  pocket = json['pocket'] != null
      ? new NamedAPIResource.fromJson(json['pocket'])
      : null;
}