UHotelReservationResponse.fromMap constructor
UHotelReservationResponse.fromMap(
- Map<String, dynamic> json
)
Implementation
factory UHotelReservationResponse.fromMap(Map<String, dynamic> json) => UHotelReservationResponse(
id: json["id"] as String,
createdAt: DateTime.parse(json["createdAt"]),
jsonData: UHotelReservationJson.fromMap(json["jsonData"]),
tags: json["tags"] == null ? <int>[] : List<int>.from(json["tags"]!.map((dynamic x) => x)),
creator: json["creator"] == null ? null : UUserResponse.fromMap(json["creator"]),
creatorId: json["creatorId"],
checkInDate: DateTime.parse(json["checkInDate"]),
checkOutDate: DateTime.parse(json["checkOutDate"]),
guestCount: json["guestCount"] == null ? 1 : (json["guestCount"] as num).toInt(),
totalPrice: (json["totalPrice"] as num).toDouble(),
userId: json["userId"] as String,
user: json["user"] == null ? null : UUserResponse.fromMap(json["user"]),
roomId: json["roomId"] as String,
room: json["room"] == null ? null : UHotelRoomResponse.fromMap(json["room"]),
hotelId: json["hotelId"] as String,
hotel: json["hotel"] == null ? null : UHotelResponse.fromMap(json["hotel"]),
isActive: !(json["isActive"] == null) && json["isActive"] as bool,
invoices: json["invoices"] == null ? <UHotelInvoiceResponse>[] : List<UHotelInvoiceResponse>.from(json["invoices"]!.map((dynamic x) => UHotelInvoiceResponse.fromMap(x))),
adminUserIds: json["adminUserIds"] == null ? <String>[] : List<String>.from(json["adminUserIds"]!.map((dynamic x) => x)),
);