MoveTarget.fromJson constructor

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

Implementation

MoveTarget.fromJson(Map<String, dynamic> json) {
  if (json['names'] != null) {
    names = new List<MoveTargetName>();
    (json['names'] as List).forEach((v) {
      names.add(new MoveTargetName.fromJson(v));
    });
  }
  if (json['moves'] != null) {
    moves = new List<NamedAPIResource>();
    (json['moves'] as List).forEach((v) {
      moves.add(new NamedAPIResource.fromJson(v));
    });
  }
  name = json['name'];
  id = json['id'];
  if (json['descriptions'] != null) {
    descriptions = new List<MoveTargetDescription>();
    (json['descriptions'] as List).forEach((v) {
      descriptions.add(new MoveTargetDescription.fromJson(v));
    });
  }
}