// To parse this JSON data, do // // final googleLocationAutoCompleteResponse = googleLocationAutoCompleteResponseFromJson(jsonString); import 'dart:convert'; GoogleLocationAutoCompleteResponse googleLocationAutoCompleteResponseFromJson(String str) => GoogleLocationAutoCompleteResponse.fromJson(json.decode(str)); String googleLocationAutoCompleteResponseToJson(GoogleLocationAutoCompleteResponse data) => json.encode(data.toJson()); class GoogleLocationAutoCompleteResponse { GoogleLocationAutoCompleteResponse({ this.predictions, this.status, }); List? predictions; String? status; factory GoogleLocationAutoCompleteResponse.fromJson(Map json) => GoogleLocationAutoCompleteResponse( predictions: List.from(json["predictions"].map((x) => Prediction.fromJson(x))), status: json["status"], ); Map toJson() => { "predictions": List.from(predictions!.map((x) => x.toJson())), "status": status, }; } class Prediction { Prediction({ this.description, this.matchedSubstrings, this.placeId, this.reference, this.structuredFormatting, this.terms, this.types, }); String? description; List? matchedSubstrings; String? placeId; String? reference; StructuredFormatting? structuredFormatting; List? terms; List? types; factory Prediction.fromJson(Map json) => Prediction( description: json["description"], matchedSubstrings: List.from(json["matched_substrings"].map((x) => MatchedSubstring.fromJson(x))), placeId: json["place_id"], reference: json["reference"], structuredFormatting: StructuredFormatting.fromJson(json["structured_formatting"]), terms: List.from(json["terms"].map((x) => Term.fromJson(x))), types: List.from(json["types"].map((x) => x)), ); Map toJson() => { "description": description, "matched_substrings": List.from(matchedSubstrings!.map((x) => x.toJson())), "place_id": placeId, "reference": reference, "structured_formatting": structuredFormatting!.toJson(), "terms": List.from(terms!.map((x) => x.toJson())), "types": List.from(types!.map((x) => x)), }; } class MatchedSubstring { MatchedSubstring({ this.length, this.offset, }); int? length; int? offset; factory MatchedSubstring.fromJson(Map json) => MatchedSubstring( length: json["length"], offset: json["offset"], ); Map toJson() => { "length": length, "offset": offset, }; } class StructuredFormatting { StructuredFormatting({ this.mainText, this.mainTextMatchedSubstrings, this.secondaryText, }); String? mainText; List? mainTextMatchedSubstrings; String? secondaryText; factory StructuredFormatting.fromJson(Map json) => StructuredFormatting( mainText: json["main_text"], mainTextMatchedSubstrings: List.from(json["main_text_matched_substrings"].map((x) => MatchedSubstring.fromJson(x))), secondaryText: json["secondary_text"], ); Map toJson() => { "main_text": mainText, "main_text_matched_substrings": List.from(mainTextMatchedSubstrings!.map((x) => x.toJson())), "secondary_text": secondaryText, }; } class Term { Term({ this.offset, this.value, }); int? offset; String? value; factory Term.fromJson(Map json) => Term( offset: json["offset"], value: json["value"], ); Map toJson() => { "offset": offset, "value": value, }; }