status added to update service request

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

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

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

Loading…
Cancel
Save