import 'package:json_annotation/json_annotation.dart'; part 'a_map_result.g.dart'; @JsonSerializable(explicitToJson: true) class AMapResult { final String? status; final Regeocode? regeocode; final String? info; final String? infocode; const AMapResult({ this.status, this.regeocode, this.info, this.infocode, }); factory AMapResult.fromJson(Map json) => _$AMapResultFromJson(json); Map toJson() => _$AMapResultToJson(this); } @JsonSerializable(explicitToJson: true) class Regeocode { final AddressComponent? addressComponent; final String? formattedAddress; const Regeocode({ this.addressComponent, this.formattedAddress, }); factory Regeocode.fromJson(Map json) => _$RegeocodeFromJson(json); Map toJson() => _$RegeocodeToJson(this); } @JsonSerializable(explicitToJson: true) class AddressComponent { final String? city; final String? province; final String? adcode; final String? district; final String? towncode; final StreetNumber? streetNumber; final String? country; final String? township; final List? businessAreas; final Building? building; final Neighborhood? neighborhood; final String? citycode; const AddressComponent({ this.city, this.province, this.adcode, this.district, this.towncode, this.streetNumber, this.country, this.township, this.businessAreas, this.building, this.neighborhood, this.citycode, }); factory AddressComponent.fromJson(Map json) => _$AddressComponentFromJson(json); Map toJson() => _$AddressComponentToJson(this); } @JsonSerializable(explicitToJson: true) class StreetNumber { final String? number; final String? location; final String? direction; final String? distance; final String? street; const StreetNumber({ this.number, this.location, this.direction, this.distance, this.street, }); factory StreetNumber.fromJson(Map json) => _$StreetNumberFromJson(json); Map toJson() => _$StreetNumberToJson(this); } @JsonSerializable(explicitToJson: true) class BusinessAreas { final String? location; final String? name; final String? id; const BusinessAreas({ this.location, this.name, this.id, }); factory BusinessAreas.fromJson(Map json) => _$BusinessAreasFromJson(json); Map toJson() => _$BusinessAreasToJson(this); } @JsonSerializable(explicitToJson: true) class Building { final List? name; final List? type; const Building({ this.name, this.type, }); factory Building.fromJson(Map json) => _$BuildingFromJson(json); Map toJson() => _$BuildingToJson(this); } @JsonSerializable(explicitToJson: true) class Neighborhood { final List? name; final List? type; const Neighborhood({ this.name, this.type, }); factory Neighborhood.fromJson(Map json) => _$NeighborhoodFromJson(json); Map toJson() => _$NeighborhoodToJson(this); }