You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
class Hospital {
|
|
|
|
|
int id;
|
|
|
|
|
int customerCode;
|
|
|
|
|
String name;
|
|
|
|
|
List buildings;
|
|
|
|
|
|
|
|
|
|
Hospital({
|
|
|
|
|
this.id,
|
|
|
|
|
this.customerCode,
|
|
|
|
|
this.name,
|
|
|
|
|
this.buildings,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
factory Hospital.fromJson(Map<String, dynamic> parsedJson) {
|
|
|
|
|
return Hospital(id: parsedJson["id"], name: parsedJson["custName"], customerCode: parsedJson["customerCode"], buildings: parsedJson["buildings"]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
factory Hospital.fromHospital(Hospital hospital) {
|
|
|
|
|
return Hospital(id: hospital?.id, name: hospital?.name, customerCode: hospital?.customerCode, buildings: hospital?.buildings);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Map<String, dynamic> toMap() {
|
|
|
|
|
return {'id': id, 'customerCode': customerCode, 'custName': name, "buildings": buildings};
|
|
|
|
|
}
|
|
|
|
|
}
|