status added to update service request

design_3.0_demo_module
zaid_daoud 3 years ago
parent 58bd5075ed
commit 0124918d29

@ -254,7 +254,11 @@ class ServiceRequestsProvider extends ChangeNotifier {
], ],
"callComments": request.callComments, "callComments": request.callComments,
"noofFollowup": 0, "noofFollowup": 0,
// "status": null, "status": request.statusId == null
? null
: {
"id": request.statusId,
},
"callLastSituation": null, "callLastSituation": null,
"firstAction": request.firstAction?.toMap(), "firstAction": request.firstAction?.toMap(),
"loanAvailablity": request.loanAvailability?.toMap(), "loanAvailablity": request.loanAvailability?.toMap(),

@ -19,6 +19,7 @@ class ServiceRequest {
String date; String date;
String audio; String audio;
int statusValue; int statusValue;
int statusId;
String statusLabel; String statusLabel;
String reviewComment; String reviewComment;
String comments; String comments;
@ -54,6 +55,7 @@ class ServiceRequest {
this.callComments, this.callComments,
this.statusLabel, this.statusLabel,
this.statusValue, this.statusValue,
this.statusId,
this.departmentName, this.departmentName,
this.deviceId, this.deviceId,
this.audio, this.audio,
@ -82,8 +84,7 @@ class ServiceRequest {
factory ServiceRequest.fromJson(Map<String, dynamic> parsedJson) { factory ServiceRequest.fromJson(Map<String, dynamic> parsedJson) {
List<String> images = []; List<String> images = [];
if(parsedJson["attachmentsCallRequest"]!=null) if (parsedJson["attachmentsCallRequest"] != null) if (parsedJson["attachmentsCallRequest"] is List) {
if (parsedJson["attachmentsCallRequest"] is List) {
List list = parsedJson["attachmentsCallRequest"]; List list = parsedJson["attachmentsCallRequest"];
images = list.map((e) => URLs.getFileUrl(e["attachmentsCallRequest"])).toList(); images = list.map((e) => URLs.getFileUrl(e["attachmentsCallRequest"])).toList();
} }
@ -104,6 +105,7 @@ class ServiceRequest {
comments: parsedJson["comments"], comments: parsedJson["comments"],
statusLabel: parsedJson["status"] == null ? null : parsedJson["status"]["name"], statusLabel: parsedJson["status"] == null ? null : parsedJson["status"]["name"],
statusValue: parsedJson["status"] == null ? null : parsedJson["status"]["value"], statusValue: parsedJson["status"] == null ? null : parsedJson["status"]["value"],
statusId: parsedJson["status"] == null ? null : parsedJson["status"]["id"],
departmentName: parsedJson["asset"]["department"] != null ? parsedJson["asset"]["department"]["name"] : "", departmentName: parsedJson["asset"]["department"] != null ? parsedJson["asset"]["department"]["name"] : "",
engineerName: parsedJson["assignedEmployee"] == null ? null : parsedJson["assignedEmployee"]["name"], engineerName: parsedJson["assignedEmployee"] == null ? null : parsedJson["assignedEmployee"]["name"],
engineerId: parsedJson["assignedEmployee"] == null ? null : parsedJson["assignedEmployee"]["id"], engineerId: parsedJson["assignedEmployee"] == null ? null : parsedJson["assignedEmployee"]["id"],

Loading…
Cancel
Save