|
|
|
@ -113,7 +113,7 @@ class GasRefillProvider extends ChangeNotifier {
|
|
|
|
"site": hospital?.toMap(),
|
|
|
|
"site": hospital?.toMap(),
|
|
|
|
"building": {"id": building?.id, "name": building?.name, "value": building?.value},
|
|
|
|
"building": {"id": building?.id, "name": building?.name, "value": building?.value},
|
|
|
|
"floor": {"id": floor?.id, "name": floor?.name, "value": floor?.value},
|
|
|
|
"floor": {"id": floor?.id, "name": floor?.name, "value": floor?.value},
|
|
|
|
if (expectedDateTime != null) "expectedDate": expectedDateTime?.toIso8601String(),
|
|
|
|
//if (expectedDateTime != null) "expectedDate": expectedDateTime?.toIso8601String(),
|
|
|
|
if (expectedDateTime != null) "expectedTime": expectedDateTime?.toIso8601String(),
|
|
|
|
if (expectedDateTime != null) "expectedTime": expectedDateTime?.toIso8601String(),
|
|
|
|
if (timer?.startAt != null) "startDate": timer.startAt.toIso8601String(),
|
|
|
|
if (timer?.startAt != null) "startDate": timer.startAt.toIso8601String(),
|
|
|
|
if (timer?.startAt != null) "startTime": timer.startAt.toIso8601String(),
|
|
|
|
if (timer?.startAt != null) "startTime": timer.startAt.toIso8601String(),
|
|
|
|
@ -159,7 +159,7 @@ class GasRefillProvider extends ChangeNotifier {
|
|
|
|
"id": newModel.id,
|
|
|
|
"id": newModel.id,
|
|
|
|
"gazRefillNo": newModel.title ?? "",
|
|
|
|
"gazRefillNo": newModel.title ?? "",
|
|
|
|
"status": newModel.status.toMap(),
|
|
|
|
"status": newModel.status.toMap(),
|
|
|
|
"expectedDate": newModel.expectedDate?.toIso8601String(),
|
|
|
|
//"expectedDate": newModel.expectedDate?.toIso8601String(),
|
|
|
|
"expectedTime": newModel.expectedDate?.toIso8601String(),
|
|
|
|
"expectedTime": newModel.expectedDate?.toIso8601String(),
|
|
|
|
if (timer?.startAt != null) "startDate": timer.startAt.toIso8601String(),
|
|
|
|
if (timer?.startAt != null) "startDate": timer.startAt.toIso8601String(),
|
|
|
|
if (timer?.startAt != null) "startTime": timer.startAt.toIso8601String(),
|
|
|
|
if (timer?.startAt != null) "startTime": timer.startAt.toIso8601String(),
|
|
|
|
@ -186,24 +186,23 @@ class GasRefillProvider extends ChangeNotifier {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.toList();
|
|
|
|
.toList();
|
|
|
|
log(body.toString());
|
|
|
|
log(body.toString());
|
|
|
|
return -1;
|
|
|
|
Response response;
|
|
|
|
// Response response;
|
|
|
|
try {
|
|
|
|
// try {
|
|
|
|
response = await ApiManager.instance.put(URLs.updateGasRefill, body: body);
|
|
|
|
// response = await ApiManager.instance.put(URLs.updateGasRefill, body: body);
|
|
|
|
// response = await post(
|
|
|
|
// // response = await post(
|
|
|
|
// Uri.parse("$host${URLs.updateGasRefill}/${newModel.id}"),
|
|
|
|
// // Uri.parse("$host${URLs.updateGasRefill}/${newModel.id}"),
|
|
|
|
// body: body,
|
|
|
|
// // body: body,
|
|
|
|
// );
|
|
|
|
// // );
|
|
|
|
|
|
|
|
//
|
|
|
|
stateCode = response.statusCode;
|
|
|
|
// stateCode = response.statusCode;
|
|
|
|
if (response.statusCode >= 200 && response.statusCode < 300) {
|
|
|
|
// if (response.statusCode >= 200 && response.statusCode < 300) {
|
|
|
|
oldModel.fromGasRefillModel(newModel);
|
|
|
|
// oldModel.fromGasRefillModel(newModel);
|
|
|
|
notifyListeners();
|
|
|
|
// notifyListeners();
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
return response.statusCode;
|
|
|
|
// return response.statusCode;
|
|
|
|
} catch (error) {
|
|
|
|
// } catch (error) {
|
|
|
|
return -1;
|
|
|
|
// return -1;
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Hospital hospital;
|
|
|
|
Hospital hospital;
|
|
|
|
|