poi_item.dart 1.4 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
class PoiItem {
  PoiItem({
    this.cityName,
    this.provinceName,
    this.adName,
    this.snippet,
    this.latitude,
    this.longitude,
    this.provinceCode,
    this.cityCode,
    this.businessArea,
    this.title,
    this.distance,
  });

  static PoiItem fromJson(dynamic json) {
    return PoiItem(
      cityName: json['cityName'],
      provinceName: json['provinceName'],
      adName: json['adName'],
      snippet: json['snippet'],
      latitude: json['latitude'],
      longitude: json['longitude'],
      provinceCode: json['provinceCode'],
      cityCode: json['cityCode'],
      businessArea: json['businessArea'],
      title: json['title'],
      distance: json['distance'],
    );
  }
  String? cityName;
  String? provinceName;
  String? adName;
  String? snippet;
  num? latitude;
  num? longitude;
  String? provinceCode;
  String? cityCode;
  String? businessArea;
  String? title;
  num? distance;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['cityName'] = cityName;
    map['provinceName'] = provinceName;
    map['adName'] = adName;
    map['snippet'] = snippet;
    map['latitude'] = latitude;
    map['longitude'] = longitude;
    map['provinceCode'] = provinceCode;
    map['cityCode'] = cityCode;
    map['businessArea'] = businessArea;
    map['title'] = title;
    map['distance'] = distance;
    return map;
  }


}