|
|
|
|
@ -104,7 +104,6 @@ class GasRefillProvider extends ChangeNotifier {
|
|
|
|
|
@required User user,
|
|
|
|
|
@required GasRefillModel model,
|
|
|
|
|
}) async {
|
|
|
|
|
print("ss");
|
|
|
|
|
Map<String, dynamic> body = {
|
|
|
|
|
"uid": user.id.toString(),
|
|
|
|
|
"token": user.token ?? "",
|
|
|
|
|
@ -121,7 +120,6 @@ class GasRefillProvider extends ChangeNotifier {
|
|
|
|
|
"GazRefillNo": "GR-${DateTime.now().toString().split(" ").first}",
|
|
|
|
|
"status": model.status.toMap(),
|
|
|
|
|
};
|
|
|
|
|
print("ss1");
|
|
|
|
|
body["gazRefillDetails"] = model.details
|
|
|
|
|
.map((model) => {
|
|
|
|
|
"gasType": model.type.toMap(),
|
|
|
|
|
@ -134,7 +132,6 @@ class GasRefillProvider extends ChangeNotifier {
|
|
|
|
|
Response response;
|
|
|
|
|
try {
|
|
|
|
|
response = await ApiManager.instance.post(URLs.requestGasRefill, body: body);
|
|
|
|
|
print("ss2");
|
|
|
|
|
stateCode = response.statusCode;
|
|
|
|
|
if (response.statusCode >= 200 && response.statusCode < 300) {
|
|
|
|
|
if (items != null) {
|
|
|
|
|
@ -159,8 +156,8 @@ class GasRefillProvider extends ChangeNotifier {
|
|
|
|
|
"id": newModel.id,
|
|
|
|
|
"gazRefillNo": newModel.title ?? "",
|
|
|
|
|
"status": newModel.status.toMap(),
|
|
|
|
|
"expectedDate": oldModel.expectedDate?.toIso8601String(),
|
|
|
|
|
"expectedTime": oldModel.expectedDate?.toIso8601String(),
|
|
|
|
|
"expectedDate": newModel.expectedDate?.toIso8601String(),
|
|
|
|
|
"expectedTime": newModel.expectedDate?.toIso8601String(),
|
|
|
|
|
"startDate": startDate?.toIso8601String(),
|
|
|
|
|
"startTime": startDate?.toIso8601String(),
|
|
|
|
|
"endDate": endDate?.toIso8601String(),
|
|
|
|
|
|