Predictions.fromJson constructor

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

Implementation

Predictions.fromJson(Map<String, dynamic> json) {
  description = json['description'];
  if (json['matched_substrings'] != null) {
    matchedSubstrings = <MatchedSubstrings>[];
    json['matched_substrings'].forEach((v) {
      matchedSubstrings!.add(new MatchedSubstrings.fromJson(v));
    });
  }
  placeId = json['place_id'];
  reference = json['reference'];
  structuredFormatting = json['structured_formatting'] != null
      ? new StructuredFormatting.fromJson(json['structured_formatting'])
      : null;
  if (json['terms'] != null) {
    terms = <Terms>[];
    json['terms'].forEach((v) {
      terms!.add(new Terms.fromJson(v));
    });
  }
  types = json['types'].cast<String>();
}