UDormBedContractResponse.fromMap constructor

UDormBedContractResponse.fromMap(
  1. Map<String, dynamic> json
)

Implementation

factory UDormBedContractResponse.fromMap(Map<String, dynamic> json) => UDormBedContractResponse(
  id: json["id"],
  createdAt: DateTime.parse(json["createdAt"]),
  jsonData: UContractJsonData.fromMap(json["jsonData"]),
  tags: json["tags"] == null ? <int>[] : List<int>.from(json["tags"]!.map((dynamic x) => x)),
  startDate: DateTime.parse(json["startDate"]),
  endDate: DateTime.parse(json["endDate"]),
  deposit: (json["deposit"] as num).toDouble(),
  rent: (json["rent"] as num).toDouble(),
  user: json["user"] == null ? null : UUserResponse.fromMap(json["user"]),
  userId: json["userId"] as String,
  bedId: json["bedId"] as String,
  bed: json["bed"] == null ? null : UDormBedResponse.fromMap(json["bed"]),
  creator: json["creator"] == null ? null : UUserResponse.fromMap(json["creator"]),
  creatorId: json["creatorId"],
  isActive: json["isActive"],
  invoices: json["invoices"] == null ? <UDormBedInvoiceResponse>[] : List<UDormBedInvoiceResponse>.from(json["invoices"]!.map((dynamic x) => UDormBedInvoiceResponse.fromMap(x))),
  adminUserIds: json["adminUserIds"] == null ? <String>[] : List<String>.from(json["adminUserIds"]!.map((dynamic x) => x)),
);