// To parse this JSON data, do // // final googleLocationDetailsResponse = googleLocationDetailsResponseFromJson(jsonString); import 'dart:convert'; GoogleLocationDetailsResponse googleLocationDetailsResponseFromJson(String str) => GoogleLocationDetailsResponse.fromJson(json.decode(str)); String googleLocationDetailsResponseToJson(GoogleLocationDetailsResponse data) => json.encode(data.toJson()); class GoogleLocationDetailsResponse { GoogleLocationDetailsResponse({ this.htmlAttributions, this.result, this.status, }); List? htmlAttributions; Result? result; String? status; factory GoogleLocationDetailsResponse.fromJson(Map json) => GoogleLocationDetailsResponse( htmlAttributions: List.from(json["html_attributions"].map((x) => x)), result: Result.fromJson(json["result"]), status: json["status"], ); Map toJson() => { "html_attributions": List.from(htmlAttributions!.map((x) => x)), "result": result!.toJson(), "status": status, }; } class Result { Result({ this.addressComponents, this.formattedAddress, this.geometry, this.placeId, this.reference, this.types, this.url, this.utcOffset, this.vicinity, }); List? addressComponents; String? formattedAddress; Geometry? geometry; String? placeId; String? reference; List? types; String? url; int? utcOffset; String? vicinity; factory Result.fromJson(Map json) => Result( addressComponents: List.from(json["address_components"].map((x) => AddressComponent.fromJson(x))), formattedAddress: json["formatted_address"], geometry: Geometry.fromJson(json["geometry"]), placeId: json["place_id"], reference: json["reference"], types: List.from(json["types"].map((x) => x)), url: json["url"], utcOffset: json["utc_offset"], vicinity: json["vicinity"], ); Map toJson() => { "address_components": List.from(addressComponents!.map((x) => x.toJson())), "formatted_address": formattedAddress, "geometry": geometry!.toJson(), "place_id": placeId, "reference": reference, "types": List.from(types!.map((x) => x)), "url": url, "utc_offset": utcOffset, "vicinity": vicinity, }; } class AddressComponent { AddressComponent({ this.longName, this.shortName, this.types, }); String? longName; String? shortName; List? types; factory AddressComponent.fromJson(Map json) => AddressComponent( longName: json["long_name"], shortName: json["short_name"], types: List.from(json["types"].map((x) => x)), ); Map toJson() => { "long_name": longName, "short_name": shortName, "types": List.from(types!.map((x) => x)), }; } class Geometry { Geometry({ this.location, this.viewport, }); Location? location; Viewport? viewport; factory Geometry.fromJson(Map json) => Geometry( location: Location.fromJson(json["location"]), viewport: Viewport.fromJson(json["viewport"]), ); Map toJson() => { "location": location!.toJson(), "viewport": viewport!.toJson(), }; } class Location { Location({ this.lat, this.lng, }); double? lat; double? lng; factory Location.fromJson(Map json) => Location( lat: json["lat"].toDouble(), lng: json["lng"].toDouble(), ); Map toJson() => { "lat": lat, "lng": lng, }; } class Viewport { Viewport({ this.northeast, this.southwest, }); Location? northeast; Location? southwest; factory Viewport.fromJson(Map json) => Viewport( northeast: Location.fromJson(json["northeast"]), southwest: Location.fromJson(json["southwest"]), ); Map toJson() => { "northeast": northeast!.toJson(), "southwest": southwest!.toJson(), }; }