|
|
|
@ -142,7 +142,9 @@ class DeliveryConfirmedPage extends StatelessWidget {
|
|
|
|
child: SecondaryButton(
|
|
|
|
child: SecondaryButton(
|
|
|
|
label: TranslationBase.of(context)
|
|
|
|
label: TranslationBase.of(context)
|
|
|
|
.nextDelivery,
|
|
|
|
.nextDelivery,
|
|
|
|
onTap: () {},
|
|
|
|
onTap: () {
|
|
|
|
|
|
|
|
getNextOrder(context, model);
|
|
|
|
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
@ -172,21 +174,25 @@ class DeliveryConfirmedPage extends StatelessWidget {
|
|
|
|
|
|
|
|
|
|
|
|
getNextOrder(BuildContext context, OrdersViewModel model) async {
|
|
|
|
getNextOrder(BuildContext context, OrdersViewModel model) async {
|
|
|
|
NextOrderRequestModel nextOrderRequestModel = NextOrderRequestModel(
|
|
|
|
NextOrderRequestModel nextOrderRequestModel = NextOrderRequestModel(
|
|
|
|
pageIndex: 0, pageSize: 0, latitude: "", longitude: "", searchKey: "");
|
|
|
|
pageIndex: 0,
|
|
|
|
|
|
|
|
pageSize: 0,
|
|
|
|
|
|
|
|
latitude: "46.621730",
|
|
|
|
|
|
|
|
longitude: "24.797682",
|
|
|
|
|
|
|
|
searchKey: "");
|
|
|
|
await model.nextOrder(nextOrderRequestModel);
|
|
|
|
await model.nextOrder(nextOrderRequestModel);
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
Utils.showErrorToast(model.error);
|
|
|
|
Utils.showErrorToast(model.error);
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
|
|
|
|
model.hideBottomSheet();
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
if (model.nextOrdersList != null && model.nextOrdersList.length == 0) {
|
|
|
|
model.hideBottomSheet();
|
|
|
|
Utils.showErrorToast("No Items in the list");
|
|
|
|
Navigator.push(
|
|
|
|
} else {
|
|
|
|
context,
|
|
|
|
Navigator.pushReplacement(
|
|
|
|
MaterialPageRoute(
|
|
|
|
context,
|
|
|
|
builder: (context) => InformationPage(item),
|
|
|
|
MaterialPageRoute(
|
|
|
|
),
|
|
|
|
builder: (context) => InformationPage(model.nextOrdersList[0]),
|
|
|
|
);
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|