|
|
|
|
@ -15,15 +15,15 @@ class OrderPage extends StatefulWidget {
|
|
|
|
|
// orderList({this.customerId, this.pageId});
|
|
|
|
|
|
|
|
|
|
String customerID;
|
|
|
|
|
String customerGUID;
|
|
|
|
|
|
|
|
|
|
OrderPage({@required this.customerID});
|
|
|
|
|
OrderPage({@required this.customerID, this.customerGUID});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
_OrderPageState createState() => _OrderPageState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _OrderPageState extends State<OrderPage>
|
|
|
|
|
with SingleTickerProviderStateMixin {
|
|
|
|
|
class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMixin {
|
|
|
|
|
String pageID = "1";
|
|
|
|
|
String customerId = "";
|
|
|
|
|
String order = "";
|
|
|
|
|
@ -57,7 +57,7 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return BaseView<OrderModelViewModel>(
|
|
|
|
|
onModelReady: (model) => model.getOrder(widget.customerID, pageID),
|
|
|
|
|
onModelReady: (model) => model.getOrder(widget.customerID, widget.customerGUID, pageID),
|
|
|
|
|
builder: (_, model, wi) => AppScaffold(
|
|
|
|
|
appBarTitle: TranslationBase.of(context).order,
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
@ -105,10 +105,9 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget getDeliveredOrder(OrderModelViewModel model) {
|
|
|
|
|
deliveredOrderList.clear();
|
|
|
|
|
for (int i = 0; i < model.orders.length; i++) {
|
|
|
|
|
if (model.orders[i].orderStatusId == 30 ||
|
|
|
|
|
model.orders[i].orderStatusId == 997 ||
|
|
|
|
|
model.orders[i].orderStatusId == 994) {
|
|
|
|
|
if (model.orders[i].orderStatusId == 30 || model.orders[i].orderStatusId == 997 || model.orders[i].orderStatusId == 994) {
|
|
|
|
|
deliveredOrderList.add(model.orders[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -132,29 +131,26 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: OrderDetailsPage(
|
|
|
|
|
orderModel:
|
|
|
|
|
deliveredOrderList[
|
|
|
|
|
index]),
|
|
|
|
|
));
|
|
|
|
|
page: OrderDetailsPage(orderModel: deliveredOrderList[index]),
|
|
|
|
|
)).then((value) {
|
|
|
|
|
model.getOrder(widget.customerID, widget.customerGUID, pageID);
|
|
|
|
|
getDeliveredOrder(model);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.all(8.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(right: 5),
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.orderNumber,
|
|
|
|
|
TranslationBase.of(context).orderNumber,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 16.0,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
@ -163,9 +159,7 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: Text(
|
|
|
|
|
deliveredOrderList[index]
|
|
|
|
|
.id
|
|
|
|
|
.toString(),
|
|
|
|
|
deliveredOrderList[index].id.toString(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 16.0,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
@ -182,8 +176,7 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(right: 5),
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.orderDate,
|
|
|
|
|
TranslationBase.of(context).orderDate,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 14.0,
|
|
|
|
|
),
|
|
|
|
|
@ -191,10 +184,7 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: Text(
|
|
|
|
|
deliveredOrderList[index]
|
|
|
|
|
.createdOnUtc
|
|
|
|
|
.toString()
|
|
|
|
|
.substring(0, 10),
|
|
|
|
|
deliveredOrderList[index].createdOnUtc.toString().substring(0, 10),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 14.0,
|
|
|
|
|
),
|
|
|
|
|
@ -208,9 +198,7 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.all(8.0),
|
|
|
|
|
child: SvgPicture.asset(
|
|
|
|
|
languageID == "ar"
|
|
|
|
|
? 'assets/images/pharmacy/arrow_left.svg'
|
|
|
|
|
: 'assets/images/pharmacy/arrow_right.svg',
|
|
|
|
|
languageID == "ar" ? 'assets/images/pharmacy/arrow_left.svg' : 'assets/images/pharmacy/arrow_right.svg',
|
|
|
|
|
height: 20,
|
|
|
|
|
width: 20,
|
|
|
|
|
),
|
|
|
|
|
@ -226,14 +214,11 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
endIndent: 0,
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
|
left: 8, right: 8, top: 1, bottom: 8),
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
left: 13.0, right: 13.0),
|
|
|
|
|
margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8),
|
|
|
|
|
padding: EdgeInsets.only(left: 13.0, right: 13.0),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
border: Border.all(
|
|
|
|
|
color: Colors.blue[700],
|
|
|
|
|
@ -241,16 +226,12 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
width: 5.0,
|
|
|
|
|
),
|
|
|
|
|
color: Colors.blue[700],
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.circular(30.0)),
|
|
|
|
|
child: deliveredOrderList[index].orderStatusId == 30 ||
|
|
|
|
|
deliveredOrderList[index].orderStatusId == 997 ||
|
|
|
|
|
deliveredOrderList[index].orderStatusId == 994
|
|
|
|
|
borderRadius: BorderRadius.circular(30.0)),
|
|
|
|
|
child: deliveredOrderList[index].orderStatusId == 30 || deliveredOrderList[index].orderStatusId == 997 || deliveredOrderList[index].orderStatusId == 994
|
|
|
|
|
// deliveredOrderList[index].orderStatusId == 30
|
|
|
|
|
? Text(
|
|
|
|
|
// deliveredOrderList[0].orderStatus.toString().substring(12),
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.deliveredOrder,
|
|
|
|
|
TranslationBase.of(context).deliveredOrder,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontSize: 15.0,
|
|
|
|
|
@ -258,13 +239,7 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: Text(
|
|
|
|
|
languageID == "ar"
|
|
|
|
|
? deliveredOrderList[index]
|
|
|
|
|
.orderStatusn
|
|
|
|
|
.toString()
|
|
|
|
|
: deliveredOrderList[index]
|
|
|
|
|
.orderStatus
|
|
|
|
|
.toString(),
|
|
|
|
|
languageID == "ar" ? deliveredOrderList[index].orderStatusn.toString() : deliveredOrderList[index].orderStatus.toString(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontSize: 15.0,
|
|
|
|
|
@ -272,8 +247,7 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
),
|
|
|
|
|
)),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
|
left: 8, right: 8, top: 1, bottom: 8),
|
|
|
|
|
margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8),
|
|
|
|
|
child: Column(
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
@ -282,9 +256,7 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(left: 5),
|
|
|
|
|
child: Text(
|
|
|
|
|
deliveredOrderList[index]
|
|
|
|
|
.orderTotal
|
|
|
|
|
.toString(),
|
|
|
|
|
deliveredOrderList[index].orderTotal.toString(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 16.0,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
@ -310,9 +282,7 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
child: Text(
|
|
|
|
|
deliveredOrderList[index]
|
|
|
|
|
.productCount
|
|
|
|
|
.toString(),
|
|
|
|
|
deliveredOrderList[index].productCount.toString(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 14.0,
|
|
|
|
|
),
|
|
|
|
|
@ -321,8 +291,7 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(left: 5),
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.itemsNo,
|
|
|
|
|
TranslationBase.of(context).itemsNo,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 14.0,
|
|
|
|
|
),
|
|
|
|
|
@ -371,11 +340,9 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget getProcessingOrder(OrderModelViewModel model) {
|
|
|
|
|
processingOrderList.clear();
|
|
|
|
|
for (int i = 0; i < model.orders.length; i++) {
|
|
|
|
|
if (model.orders[i].orderStatusId == 20 ||
|
|
|
|
|
model.orders[i].orderStatusId == 995 ||
|
|
|
|
|
model.orders[i].orderStatusId == 998 ||
|
|
|
|
|
model.orders[i].orderStatusId == 999) {
|
|
|
|
|
if (model.orders[i].orderStatusId == 20 || model.orders[i].orderStatusId == 995 || model.orders[i].orderStatusId == 998 || model.orders[i].orderStatusId == 999) {
|
|
|
|
|
processingOrderList.add(model.orders[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -396,31 +363,26 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: OrderDetailsPage(
|
|
|
|
|
orderModel:
|
|
|
|
|
processingOrderList[
|
|
|
|
|
index])));
|
|
|
|
|
Navigator.push(context, FadePage(page: OrderDetailsPage(orderModel: processingOrderList[index]))).then((value) {
|
|
|
|
|
model.getOrder(widget.customerID, widget.customerGUID, pageID).then((value) {
|
|
|
|
|
getProcessingOrder(model);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.all(8.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(right: 5),
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.orderNumber,
|
|
|
|
|
TranslationBase.of(context).orderNumber,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 16.0,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
@ -429,9 +391,7 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: Text(
|
|
|
|
|
processingOrderList[index]
|
|
|
|
|
.id
|
|
|
|
|
.toString(),
|
|
|
|
|
processingOrderList[index].id.toString(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 16.0,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
@ -448,8 +408,7 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(right: 5),
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.orderDate,
|
|
|
|
|
TranslationBase.of(context).orderDate,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 14.0,
|
|
|
|
|
),
|
|
|
|
|
@ -457,10 +416,7 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: Text(
|
|
|
|
|
processingOrderList[index]
|
|
|
|
|
.createdOnUtc
|
|
|
|
|
.toString()
|
|
|
|
|
.substring(0, 10),
|
|
|
|
|
processingOrderList[index].createdOnUtc.toString().substring(0, 10),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 14.0,
|
|
|
|
|
),
|
|
|
|
|
@ -474,9 +430,7 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.all(8.0),
|
|
|
|
|
child: SvgPicture.asset(
|
|
|
|
|
languageID == "ar"
|
|
|
|
|
? 'assets/images/pharmacy/arrow_left.svg'
|
|
|
|
|
: 'assets/images/pharmacy/arrow_right.svg',
|
|
|
|
|
languageID == "ar" ? 'assets/images/pharmacy/arrow_left.svg' : 'assets/images/pharmacy/arrow_right.svg',
|
|
|
|
|
height: 20,
|
|
|
|
|
width: 20,
|
|
|
|
|
),
|
|
|
|
|
@ -492,14 +446,11 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
endIndent: 0,
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
|
left: 8, right: 8, top: 1, bottom: 8),
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
left: 13.0, right: 13.0),
|
|
|
|
|
margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8),
|
|
|
|
|
padding: EdgeInsets.only(left: 13.0, right: 13.0),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
border: Border.all(
|
|
|
|
|
color: Colors.green,
|
|
|
|
|
@ -507,17 +458,15 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
width: 5.0,
|
|
|
|
|
),
|
|
|
|
|
color: Colors.green,
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.circular(30.0)),
|
|
|
|
|
child: processingOrderList[index].orderStatusId == 20 ||
|
|
|
|
|
processingOrderList[index].orderStatusId == 995 ||
|
|
|
|
|
processingOrderList[index].orderStatusId == 998 ||
|
|
|
|
|
processingOrderList[index].orderStatusId == 999
|
|
|
|
|
borderRadius: BorderRadius.circular(30.0)),
|
|
|
|
|
child: processingOrderList[index].orderStatusId == 20 ||
|
|
|
|
|
processingOrderList[index].orderStatusId == 995 ||
|
|
|
|
|
processingOrderList[index].orderStatusId == 998 ||
|
|
|
|
|
processingOrderList[index].orderStatusId == 999
|
|
|
|
|
// processingOrderList[index].orderStatusId == 20
|
|
|
|
|
? Text(
|
|
|
|
|
// deliveredOrderList[0].orderStatus.toString().substring(12),
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.processingOrder,
|
|
|
|
|
TranslationBase.of(context).processingOrder,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontSize: 15.0,
|
|
|
|
|
@ -525,13 +474,7 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: Text(
|
|
|
|
|
languageID == "ar"
|
|
|
|
|
? processingOrderList[index]
|
|
|
|
|
.orderStatusn
|
|
|
|
|
.toString()
|
|
|
|
|
: processingOrderList[index]
|
|
|
|
|
.orderStatus
|
|
|
|
|
.toString(),
|
|
|
|
|
languageID == "ar" ? processingOrderList[index].orderStatusn.toString() : processingOrderList[index].orderStatus.toString(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontSize: 15.0,
|
|
|
|
|
@ -539,8 +482,7 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
),
|
|
|
|
|
)),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
|
left: 8, right: 8, top: 1, bottom: 8),
|
|
|
|
|
margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8),
|
|
|
|
|
child: Column(
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
@ -549,9 +491,7 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(left: 5),
|
|
|
|
|
child: Text(
|
|
|
|
|
processingOrderList[index]
|
|
|
|
|
.orderTotal
|
|
|
|
|
.toString(),
|
|
|
|
|
processingOrderList[index].orderTotal.toString(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 16.0,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
@ -577,9 +517,7 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
child: Text(
|
|
|
|
|
processingOrderList[index]
|
|
|
|
|
.productCount
|
|
|
|
|
.toString(),
|
|
|
|
|
processingOrderList[index].productCount.toString(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 14.0,
|
|
|
|
|
),
|
|
|
|
|
@ -588,8 +526,7 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(left: 5),
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.itemsNo,
|
|
|
|
|
TranslationBase.of(context).itemsNo,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 14.0,
|
|
|
|
|
),
|
|
|
|
|
@ -817,6 +754,7 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget getPendingOrder(OrderModelViewModel model) {
|
|
|
|
|
pendingOrderList.clear();
|
|
|
|
|
for (int i = 0; i < model.orders.length; i++) {
|
|
|
|
|
if (model.orders[i].orderStatusId == 10) {
|
|
|
|
|
pendingOrderList.add(model.orders[i]);
|
|
|
|
|
@ -839,32 +777,26 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: OrderDetailsPage(
|
|
|
|
|
orderModel:
|
|
|
|
|
pendingOrderList[
|
|
|
|
|
index])));
|
|
|
|
|
Navigator.push(context, FadePage(page: OrderDetailsPage(orderModel: pendingOrderList[index]))).then((value) {
|
|
|
|
|
model.getOrder(widget.customerID, widget.customerGUID, pageID).then((value) {
|
|
|
|
|
getPendingOrder(model);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.all(8.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
margin:
|
|
|
|
|
EdgeInsets.only(right: 5),
|
|
|
|
|
margin: EdgeInsets.only(right: 5),
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.orderNumber,
|
|
|
|
|
TranslationBase.of(context).orderNumber,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 16.0,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
@ -873,9 +805,7 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: Text(
|
|
|
|
|
pendingOrderList[index]
|
|
|
|
|
.id
|
|
|
|
|
.toString(),
|
|
|
|
|
pendingOrderList[index].id.toString(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 16.0,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
@ -890,11 +820,9 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
margin:
|
|
|
|
|
EdgeInsets.only(right: 5),
|
|
|
|
|
margin: EdgeInsets.only(right: 5),
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.orderDate,
|
|
|
|
|
TranslationBase.of(context).orderDate,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 14.0,
|
|
|
|
|
),
|
|
|
|
|
@ -902,10 +830,7 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: Text(
|
|
|
|
|
pendingOrderList[index]
|
|
|
|
|
.createdOnUtc
|
|
|
|
|
.toString()
|
|
|
|
|
.substring(0, 10),
|
|
|
|
|
pendingOrderList[index].createdOnUtc.toString().substring(0, 10),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 14.0,
|
|
|
|
|
),
|
|
|
|
|
@ -919,9 +844,7 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.all(8.0),
|
|
|
|
|
child: SvgPicture.asset(
|
|
|
|
|
languageID == "ar"
|
|
|
|
|
? 'assets/images/pharmacy/arrow_left.svg'
|
|
|
|
|
: 'assets/images/pharmacy/arrow_right.svg',
|
|
|
|
|
languageID == "ar" ? 'assets/images/pharmacy/arrow_left.svg' : 'assets/images/pharmacy/arrow_right.svg',
|
|
|
|
|
height: 20,
|
|
|
|
|
width: 20,
|
|
|
|
|
),
|
|
|
|
|
@ -937,13 +860,11 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
endIndent: 0,
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.all(8.0),
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
left: 13.0, right: 13.0),
|
|
|
|
|
padding: EdgeInsets.only(left: 13.0, right: 13.0),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
border: Border.all(
|
|
|
|
|
color: Colors.orange[300],
|
|
|
|
|
@ -951,15 +872,11 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
width: 5.0,
|
|
|
|
|
),
|
|
|
|
|
color: Colors.orange[300],
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.circular(30.0)),
|
|
|
|
|
child: pendingOrderList[index]
|
|
|
|
|
.orderStatusId ==
|
|
|
|
|
10
|
|
|
|
|
borderRadius: BorderRadius.circular(30.0)),
|
|
|
|
|
child: pendingOrderList[index].orderStatusId == 10
|
|
|
|
|
? Text(
|
|
|
|
|
// deliveredOrderList[0].orderStatus.toString().substring(12),
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.pendingOrder,
|
|
|
|
|
TranslationBase.of(context).pendingOrder,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontSize: 15.0,
|
|
|
|
|
@ -967,13 +884,7 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: Text(
|
|
|
|
|
languageID == "ar"
|
|
|
|
|
? pendingOrderList[index]
|
|
|
|
|
.orderStatusn
|
|
|
|
|
.toString()
|
|
|
|
|
: pendingOrderList[index]
|
|
|
|
|
.orderStatus
|
|
|
|
|
.toString(),
|
|
|
|
|
languageID == "ar" ? pendingOrderList[index].orderStatusn.toString() : pendingOrderList[index].orderStatus.toString(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontSize: 15.0,
|
|
|
|
|
@ -988,12 +899,9 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
margin:
|
|
|
|
|
EdgeInsets.only(left: 5),
|
|
|
|
|
margin: EdgeInsets.only(left: 5),
|
|
|
|
|
child: Text(
|
|
|
|
|
pendingOrderList[index]
|
|
|
|
|
.orderTotal
|
|
|
|
|
.toString(),
|
|
|
|
|
pendingOrderList[index].orderTotal.toString(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 16.0,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
@ -1001,11 +909,9 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin:
|
|
|
|
|
EdgeInsets.only(left: 5),
|
|
|
|
|
margin: EdgeInsets.only(left: 5),
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.sar,
|
|
|
|
|
TranslationBase.of(context).sar,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 16.0,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
@ -1021,20 +927,16 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
child: Text(
|
|
|
|
|
pendingOrderList[index]
|
|
|
|
|
.productCount
|
|
|
|
|
.toString(),
|
|
|
|
|
pendingOrderList[index].productCount.toString(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 14.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin:
|
|
|
|
|
EdgeInsets.only(left: 5),
|
|
|
|
|
margin: EdgeInsets.only(left: 5),
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.itemsNo,
|
|
|
|
|
TranslationBase.of(context).itemsNo,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 14.0,
|
|
|
|
|
),
|
|
|
|
|
@ -1084,10 +986,9 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget getCancelledOrder(OrderModelViewModel model) {
|
|
|
|
|
cancelledOrderList.clear();
|
|
|
|
|
for (int i = 0; i < model.orders.length; i++) {
|
|
|
|
|
if (model.orders[i].orderStatusId == 40 ||
|
|
|
|
|
model.orders[i].orderStatus == 996 ||
|
|
|
|
|
model.orders[i].orderStatusId == 200) {
|
|
|
|
|
if (model.orders[i].orderStatusId == 40 || model.orders[i].orderStatus == 996 || model.orders[i].orderStatusId == 200) {
|
|
|
|
|
cancelledOrderList.add(model.orders[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -1108,32 +1009,26 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: OrderDetailsPage(
|
|
|
|
|
orderModel:
|
|
|
|
|
cancelledOrderList[
|
|
|
|
|
index])));
|
|
|
|
|
Navigator.push(context, FadePage(page: OrderDetailsPage(orderModel: cancelledOrderList[index]))).then((value) {
|
|
|
|
|
model.getOrder(widget.customerID, widget.customerGUID, pageID).then((value) {
|
|
|
|
|
getCancelledOrder(model);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.all(8.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
margin:
|
|
|
|
|
EdgeInsets.only(right: 5),
|
|
|
|
|
margin: EdgeInsets.only(right: 5),
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.orderNumber,
|
|
|
|
|
TranslationBase.of(context).orderNumber,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 16.0,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
@ -1142,9 +1037,7 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: Text(
|
|
|
|
|
cancelledOrderList[index]
|
|
|
|
|
.id
|
|
|
|
|
.toString(),
|
|
|
|
|
cancelledOrderList[index].id.toString(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 16.0,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
@ -1159,11 +1052,9 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
margin:
|
|
|
|
|
EdgeInsets.only(right: 5),
|
|
|
|
|
margin: EdgeInsets.only(right: 5),
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.orderDate,
|
|
|
|
|
TranslationBase.of(context).orderDate,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 14.0,
|
|
|
|
|
),
|
|
|
|
|
@ -1171,10 +1062,7 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: Text(
|
|
|
|
|
cancelledOrderList[index]
|
|
|
|
|
.createdOnUtc
|
|
|
|
|
.toString()
|
|
|
|
|
.substring(0, 10),
|
|
|
|
|
cancelledOrderList[index].createdOnUtc.toString().substring(0, 10),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 14.0,
|
|
|
|
|
),
|
|
|
|
|
@ -1188,9 +1076,7 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.all(8.0),
|
|
|
|
|
child: SvgPicture.asset(
|
|
|
|
|
languageID == "ar"
|
|
|
|
|
? 'assets/images/pharmacy/arrow_left.svg'
|
|
|
|
|
: 'assets/images/pharmacy/arrow_right.svg',
|
|
|
|
|
languageID == "ar" ? 'assets/images/pharmacy/arrow_left.svg' : 'assets/images/pharmacy/arrow_right.svg',
|
|
|
|
|
height: 20,
|
|
|
|
|
width: 20,
|
|
|
|
|
),
|
|
|
|
|
@ -1206,17 +1092,11 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
endIndent: 0,
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
|
left: 8,
|
|
|
|
|
right: 8,
|
|
|
|
|
top: 1,
|
|
|
|
|
bottom: 8),
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
left: 10.0, right: 10.0),
|
|
|
|
|
margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8),
|
|
|
|
|
padding: EdgeInsets.only(left: 10.0, right: 10.0),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
border: Border.all(
|
|
|
|
|
color: Colors.red[900],
|
|
|
|
|
@ -1224,15 +1104,11 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
width: 5.0,
|
|
|
|
|
),
|
|
|
|
|
color: Colors.red[900],
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.circular(30.0)),
|
|
|
|
|
child: cancelledOrderList[index]
|
|
|
|
|
.orderStatusId ==
|
|
|
|
|
40
|
|
|
|
|
borderRadius: BorderRadius.circular(30.0)),
|
|
|
|
|
child: cancelledOrderList[index].orderStatusId == 40
|
|
|
|
|
? Text(
|
|
|
|
|
// deliveredOrderList[0].orderStatus.toString().substring(12),
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.cancelledOrder,
|
|
|
|
|
TranslationBase.of(context).cancelledOrder,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontSize: 15.0,
|
|
|
|
|
@ -1240,13 +1116,7 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: Text(
|
|
|
|
|
languageID == "ar"
|
|
|
|
|
? cancelledOrderList[index]
|
|
|
|
|
.orderStatusn
|
|
|
|
|
.toString()
|
|
|
|
|
: cancelledOrderList[index]
|
|
|
|
|
.orderStatus
|
|
|
|
|
.toString(),
|
|
|
|
|
languageID == "ar" ? cancelledOrderList[index].orderStatusn.toString() : cancelledOrderList[index].orderStatus.toString(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontSize: 15.0,
|
|
|
|
|
@ -1254,20 +1124,16 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
),
|
|
|
|
|
)),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
|
left: 8, right: 8, top: 1, bottom: 8),
|
|
|
|
|
margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8),
|
|
|
|
|
child: Column(
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
margin:
|
|
|
|
|
EdgeInsets.only(left: 5),
|
|
|
|
|
margin: EdgeInsets.only(left: 5),
|
|
|
|
|
child: Text(
|
|
|
|
|
cancelledOrderList[index]
|
|
|
|
|
.orderTotal
|
|
|
|
|
.toString(),
|
|
|
|
|
cancelledOrderList[index].orderTotal.toString(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 16.0,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
@ -1275,11 +1141,9 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin:
|
|
|
|
|
EdgeInsets.only(left: 5),
|
|
|
|
|
margin: EdgeInsets.only(left: 5),
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.sar,
|
|
|
|
|
TranslationBase.of(context).sar,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 16.0,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
@ -1295,20 +1159,16 @@ class _OrderPageState extends State<OrderPage>
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
child: Text(
|
|
|
|
|
cancelledOrderList[index]
|
|
|
|
|
.productCount
|
|
|
|
|
.toString(),
|
|
|
|
|
cancelledOrderList[index].productCount.toString(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 14.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin:
|
|
|
|
|
EdgeInsets.only(left: 5),
|
|
|
|
|
margin: EdgeInsets.only(left: 5),
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.itemsNo,
|
|
|
|
|
TranslationBase.of(context).itemsNo,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 14.0,
|
|
|
|
|
),
|
|
|
|
|
|