Untitled

mail@pastecode.io avatar
unknown
dart
2 years ago
4.0 kB
1
Indexable
Never
class StateInfoModel {
  Result result;

  StateInfoModel({this.result});

  StateInfoModel.fromJson(Map<String, dynamic> json) {
    result =
        json['Result'] != null ? new Result.fromJson(json['Result']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.result != null) {
      data['Result'] = this.result.toJson();
    }
    return data;
  }
}

class Result {
  CustomerRequest customerRequest;
  String sId;
  String state;
  String deviceID;
  String saveTime;
  Customer customer;

  Result(
      {this.customerRequest,
      this.sId,
      this.state,
      this.deviceID,
      this.saveTime,
      this.customer});

  Result.fromJson(Map<String, dynamic> json) {
    customerRequest = json['CustomerRequest'] != null
        ? new CustomerRequest.fromJson(json['CustomerRequest'])
        : null;
    sId = json['_id'];
    state = json['State'];
    deviceID = json['DeviceID'];
    saveTime = json['SaveTime'];
    customer = json['Customer'] != null
        ? new Customer.fromJson(json['Customer'])
        : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.customerRequest != null) {
      data['CustomerRequest'] = this.customerRequest.toJson();
    }
    data['_id'] = this.sId;
    data['State'] = this.state;
    data['DeviceID'] = this.deviceID;
    data['SaveTime'] = this.saveTime;
    if (this.customer != null) {
      data['Customer'] = this.customer.toJson();
    }
    return data;
  }
}

class CustomerRequest {
  double beginLat;
  double beginLng;
  double endLat;
  double endLng;
  String userID;
  String beginCity;
  String endCity;
  int routeIndex;
  int payMethods;

  CustomerRequest(
      {this.beginLat,
      this.beginLng,
      this.endLat,
      this.endLng,
      this.userID,
      this.beginCity,
      this.endCity,
      this.routeIndex,
      this.payMethods});

  CustomerRequest.fromJson(Map<String, dynamic> json) {
    beginLat = json['BeginLat'];
    beginLng = json['BeginLng'];
    endLat = json['EndLat'];
    endLng = json['EndLng'];
    userID = json['UserID'];
    beginCity = json['BeginCity'];
    endCity = json['EndCity'];
    routeIndex = json['RouteIndex'];
    payMethods = json['PayMethods'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['BeginLat'] = this.beginLat;
    data['BeginLng'] = this.beginLng;
    data['EndLat'] = this.endLat;
    data['EndLng'] = this.endLng;
    data['UserID'] = this.userID;
    data['BeginCity'] = this.beginCity;
    data['EndCity'] = this.endCity;
    data['RouteIndex'] = this.routeIndex;
    data['PayMethods'] = this.payMethods;
    return data;
  }
}

class Customer {
  String sId;
  String name;
  String surname;
  String phone;
  String email;
  String saveTime;
  String password;
  String profilePicturePath;
  String isVerified;

  Customer(
      {this.sId,
      this.name,
      this.surname,
      this.phone,
      this.email,
      this.saveTime,
      this.password,
      this.profilePicturePath,
      this.isVerified});

  Customer.fromJson(Map<String, dynamic> json) {
    sId = json['_id'];
    name = json['Name'];
    surname = json['Surname'];
    phone = json['Phone'];
    email = json['Email'];
    saveTime = json['SaveTime'];
    password = json['Password'];
    profilePicturePath = json['ProfilePicturePath'];
    isVerified = json['IsVerified'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['_id'] = this.sId;
    data['Name'] = this.name;
    data['Surname'] = this.surname;
    data['Phone'] = this.phone;
    data['Email'] = this.email;
    data['SaveTime'] = this.saveTime;
    data['Password'] = this.password;
    data['ProfilePicturePath'] = this.profilePicturePath;
    data['IsVerified'] = this.isVerified;
    return data;
  }
}