You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

194 regels
5.4 KiB

  1. import 'dart:convert';
  2. class TodayMeetingModel {
  3. List<Meeting>? meetings;
  4. String? note;
  5. TodayMeetingModel({
  6. this.meetings,
  7. this.note,
  8. });
  9. factory TodayMeetingModel.fromRawJson(String str) => TodayMeetingModel.fromJson(json.decode(str));
  10. String toRawJson() => json.encode(toJson());
  11. factory TodayMeetingModel.fromJson(Map<String, dynamic> json) => TodayMeetingModel(
  12. meetings: json["meetings"] == null ? [] : List<Meeting>.from(json["meetings"]!.map((x) => Meeting.fromJson(x))),
  13. note: json["note"],
  14. );
  15. Map<String, dynamic> toJson() => {
  16. "meetings": meetings == null ? [] : List<dynamic>.from(meetings!.map((x) => x.toJson())),
  17. "note": note,
  18. };
  19. }
  20. class Meeting {
  21. int? id;
  22. int? locationsId;
  23. int? subjectId;
  24. int? managerId;
  25. int? ownerId;
  26. String? azHour;
  27. String? taHour;
  28. dynamic description;
  29. int? status;
  30. int? accepted;
  31. DateTime? dateMeeting;
  32. DateTime? endDate;
  33. DateTime? createdAt;
  34. DateTime? updatedAt;
  35. String? dateJalali;
  36. String? statusTxt;
  37. String? az;
  38. String? ta;
  39. Location? location;
  40. Subject? subject;
  41. Meeting({
  42. this.id,
  43. this.locationsId,
  44. this.subjectId,
  45. this.managerId,
  46. this.ownerId,
  47. this.azHour,
  48. this.taHour,
  49. this.description,
  50. this.status,
  51. this.accepted,
  52. this.dateMeeting,
  53. this.endDate,
  54. this.createdAt,
  55. this.updatedAt,
  56. this.dateJalali,
  57. this.statusTxt,
  58. this.az,
  59. this.ta,
  60. this.location,
  61. this.subject,
  62. });
  63. factory Meeting.fromRawJson(String str) => Meeting.fromJson(json.decode(str));
  64. String toRawJson() => json.encode(toJson());
  65. factory Meeting.fromJson(Map<String, dynamic> json) => Meeting(
  66. id: json["id"],
  67. locationsId: json["locations_id"],
  68. subjectId: json["subject_id"],
  69. managerId: json["manager_id"],
  70. ownerId: json["owner_id"],
  71. azHour: json["az_hour"],
  72. taHour: json["ta_hour"],
  73. description: json["description"],
  74. status: json["status"],
  75. accepted: json["accepted"],
  76. dateMeeting: json["date_meeting"] == null ? null : DateTime.parse(json["date_meeting"]),
  77. endDate: json["end_date"] == null ? null : DateTime.parse(json["end_date"]),
  78. createdAt: json["created_at"] == null ? null : DateTime.parse(json["created_at"]),
  79. updatedAt: json["updated_at"] == null ? null : DateTime.parse(json["updated_at"]),
  80. dateJalali: json["date_jalali"],
  81. statusTxt: json["status_txt"],
  82. az: json["az"],
  83. ta: json["ta"],
  84. location: json["location"] == null ? null : Location.fromJson(json["location"]),
  85. subject: json["subject"] == null ? null : Subject.fromJson(json["subject"]),
  86. );
  87. Map<String, dynamic> toJson() => {
  88. "id": id,
  89. "locations_id": locationsId,
  90. "subject_id": subjectId,
  91. "manager_id": managerId,
  92. "owner_id": ownerId,
  93. "az_hour": azHour,
  94. "ta_hour": taHour,
  95. "description": description,
  96. "status": status,
  97. "accepted": accepted,
  98. "date_meeting": dateMeeting?.toIso8601String(),
  99. "end_date": endDate?.toIso8601String(),
  100. "created_at": createdAt?.toIso8601String(),
  101. "updated_at": updatedAt?.toIso8601String(),
  102. "date_jalali": dateJalali,
  103. "status_txt": statusTxt,
  104. "az": az,
  105. "ta": ta,
  106. "location": location?.toJson(),
  107. "subject": subject?.toJson(),
  108. };
  109. }
  110. class Location {
  111. int? id;
  112. String? address;
  113. String? addressEn;
  114. DateTime? createdAt;
  115. DateTime? updatedAt;
  116. Location({
  117. this.id,
  118. this.address,
  119. this.addressEn,
  120. this.createdAt,
  121. this.updatedAt,
  122. });
  123. factory Location.fromRawJson(String str) => Location.fromJson(json.decode(str));
  124. String toRawJson() => json.encode(toJson());
  125. factory Location.fromJson(Map<String, dynamic> json) => Location(
  126. id: json["id"],
  127. address: json["address"],
  128. addressEn: json["address_en"],
  129. createdAt: json["created_at"] == null ? null : DateTime.parse(json["created_at"]),
  130. updatedAt: json["updated_at"] == null ? null : DateTime.parse(json["updated_at"]),
  131. );
  132. Map<String, dynamic> toJson() => {
  133. "id": id,
  134. "address": address,
  135. "address_en": addressEn,
  136. "created_at": createdAt?.toIso8601String(),
  137. "updated_at": updatedAt?.toIso8601String(),
  138. };
  139. }
  140. class Subject {
  141. int? id;
  142. dynamic subject;
  143. dynamic subjectEn;
  144. DateTime? createdAt;
  145. DateTime? updatedAt;
  146. Subject({
  147. this.id,
  148. this.subject,
  149. this.subjectEn,
  150. this.createdAt,
  151. this.updatedAt,
  152. });
  153. factory Subject.fromRawJson(String str) => Subject.fromJson(json.decode(str));
  154. String toRawJson() => json.encode(toJson());
  155. factory Subject.fromJson(Map<String, dynamic> json) => Subject(
  156. id: json["id"],
  157. subject: json["subject"],
  158. subjectEn: json["subject_en"],
  159. createdAt: json["created_at"] == null ? null : DateTime.parse(json["created_at"]),
  160. updatedAt: json["updated_at"] == null ? null : DateTime.parse(json["updated_at"]),
  161. );
  162. Map<String, dynamic> toJson() => {
  163. "id": id,
  164. "subject": subject,
  165. "subject_en": subjectEn,
  166. "created_at": createdAt?.toIso8601String(),
  167. "updated_at": updatedAt?.toIso8601String(),
  168. };
  169. }