class ProjectAvgERWaitingTime {
  int? iD;
  int? projectID;
  int? avgTimeInMinutes;
  String? avgTimeInHHMM;
  dynamic distanceInKilometers;
  String? latitude;
  String? longitude;
  String? phonenumber;
  String? projectImageURL;
  String? projectName;

  ProjectAvgERWaitingTime(
      {this.iD,
        this.projectID,
        this.avgTimeInMinutes,
        this.avgTimeInHHMM,
        this.distanceInKilometers,
        this.latitude,
        this.longitude,
        this.phonenumber,
        this.projectImageURL,
        this.projectName});

  ProjectAvgERWaitingTime.fromJson(Map<String, dynamic> json) {
    iD = json['ID'];
    projectID = json['ProjectID'];
    avgTimeInMinutes = json['AvgTimeInMinutes'];
    avgTimeInHHMM = json['AvgTimeInHHMM'];
    distanceInKilometers = json['DistanceInKilometers'];
    latitude = json['Latitude'];
    longitude = json['Longitude'];
    phonenumber = json['PhoneNumber'];
    projectImageURL = json['ProjectImageURL'];
    projectName = json['ProjectName'];
  }

  String getTime(){
    print("the name is $projectName");
    print("the avgTimeInMinutes is $avgTimeInMinutes");
    if(avgTimeInMinutes == null) return "";
    int hours = avgTimeInMinutes! ~/ 60;
    int minutes = avgTimeInMinutes! % 60;
    print("the time is ${"${hours.toString().padLeft(2, '0')}:${minutes.toString().padLeft(2, '0')}"}");
    return "${hours.toString().padLeft(2, '0')}:${minutes.toString().padLeft(2, '0')}";
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['ID'] = this.iD;
    data['ProjectID'] = this.projectID;
    data['AvgTimeInMinutes'] = this.avgTimeInMinutes;
    data['AvgTimeInHHMM'] = this.avgTimeInHHMM;
    data['DistanceInKilometers'] = this.distanceInKilometers;
    data['Latitude'] = this.latitude;
    data['Longitude'] = this.longitude;
    data['PhoneNumber'] = this.phonenumber;
    data['ProjectImageURL'] = this.projectImageURL;
    data['ProjectName'] = this.projectName;
    return data;
  }
}
//class ProjectAvgERWaitingTime {
//  int? iD;
//  int? projectID;
//  int? avgTimeInMinutes;
//  String? avgTimeInHHMM;
//  String? distanceInKilometers;
//  String? latitude;
//  String? longitude;
//  String? phonenum?ber;
//  String? projectImageURL;
//  String? projectName;
//
//  ProjectAvgERWaitingTime(
//      {this.iD,
//        this.projectID,
//        this.avgTimeInMinutes,
//        this.avgTimeInHHMM,
//        this.distanceInKilometers,
//        this.latitude,
//        this.longitude,
//        this.phonenum?ber,
//        this.projectImageURL,
//        this.projectName});
//
//  ProjectAvgERWaitingTime.fromJson(Map<String, dynamic> json) {
//    iD = json['ID'];
//    projectID = json['ProjectID'];
//    avgTimeInMinutes = json['AvgTimeInMinutes'];
//    avgTimeInHHMM = json['AvgTimeInHHMM'];
//    distanceInKilometers = json['DistanceInKilometers'];
//    latitude = json['Latitude'];
//    longitude = json['Longitude'];
//    phonenum?ber = json['Phonenum?ber'];
//    projectImageURL = json['ProjectImageURL'];
//    projectName = json['ProjectName'];
//  }
//
//  Map<String, dynamic> toJson() {
//    final Map<String, dynamic> data = new Map<String, dynamic>();
//    data['ID'] = this.iD;
//    data['ProjectID'] = this.projectID;
//    data['AvgTimeInMinutes'] = this.avgTimeInMinutes;
//    data['AvgTimeInHHMM'] = this.avgTimeInHHMM;
//    data['DistanceInKilometers'] = this.distanceInKilometers;
//    data['Latitude'] = this.latitude;
//    data['Longitude'] = this.longitude;
//    data['Phonenum?ber'] = this.phonenum?ber;
//    data['ProjectImageURL'] = this.projectImageURL;
//    data['ProjectName'] = this.projectName;
//    return data;
//  }
//}