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.
cloudsolutions-atoms/lib/models/hospital.dart

41 lines
798 B
Dart

3 years ago
class Hospital{
3 years ago
int id;
3 years ago
int customerCode;
3 years ago
String name;
3 years ago
List buildings;
3 years ago
Hospital({
this.id,
3 years ago
this.customerCode,
3 years ago
this.name,
3 years ago
this.buildings,
3 years ago
});
3 years ago
3 years ago
factory Hospital.fromJson(Map<String,dynamic> parsedJson){
return Hospital(
3 years ago
id: parsedJson["id"],
name: parsedJson["custName"],
3 years ago
customerCode: parsedJson["customerCode"],
buildings: parsedJson["buildings"]
3 years ago
);
}
factory Hospital.fromHospital(Hospital hospital){
return Hospital(
id: hospital?.id,
name: hospital?.name,
3 years ago
customerCode: hospital?.customerCode,
buildings:hospital?.buildings
3 years ago
);
}
3 years ago
Map<String, dynamic> toMap() {
return {
'id': id,
'customerCode': customerCode,
'custName': name,
"buildings":buildings
};
}
3 years ago
}