/*
 * @Author: WuXiangNan
 * @Date: 2021-02-19 10:44:49
 * @LastEditTime : 2023-02-03 09:31:44
 * @LastEditors  : WuWei
 * @Description: 定位信息
 */

class LocationInfo {
  double? latitude;
  double? longitude;
  // String address;
  // String street;
  // String streetNumber;
  // String description;

  LocationInfo({
    this.latitude,
    this.longitude,
    // this.address,
    // this.street,
    // this.streetNumber,
    // this.description,
  });

  LocationInfo.fromJson(json) {
    Map<String, dynamic> map = Map.from(json ?? {});
    latitude = map['latitude'] is double
        ? map['latitude']
        : double.parse(map['latitude'] ?? '0');
    longitude = map['longitude'] is double
        ? map['longitude']
        : map['longitude'] != null
            ? double.parse(map['longitude'])
            : 0;
    // address = map['address'];
    // street = map['street'];
    // streetNumber = map['streetNumber'];
    // description = map['description'];
  }

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = Map<String, dynamic>();

    json['latitude'] = this.latitude;
    json['longitude'] = this.longitude;
    // json['address'] = this.address;
    // json['street'] = this.street;
    // json['streetNumber'] = this.streetNumber;
    // json['description'] = this.description;

    return json;
  }
}
