|
|
|
@ -1,6 +1,7 @@
|
|
|
|
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
|
|
|
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/model/pharmacies/orders_model.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/model/pharmacies/orders_model.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart';
|
|
|
|
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/pharmacy/order/OrderDetails.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/pharmacy/order/OrderDetails.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
@ -8,6 +9,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_svg/flutter_svg.dart';
|
|
|
|
import 'package:flutter_svg/flutter_svg.dart';
|
|
|
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
|
|
dynamic languageID;
|
|
|
|
dynamic languageID;
|
|
|
|
|
|
|
|
|
|
|
|
@ -23,7 +25,8 @@ class OrderPage extends StatefulWidget {
|
|
|
|
_OrderPageState createState() => _OrderPageState();
|
|
|
|
_OrderPageState createState() => _OrderPageState();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMixin {
|
|
|
|
class _OrderPageState extends State<OrderPage>
|
|
|
|
|
|
|
|
with SingleTickerProviderStateMixin {
|
|
|
|
String pageID = "1";
|
|
|
|
String pageID = "1";
|
|
|
|
String customerId = "";
|
|
|
|
String customerId = "";
|
|
|
|
String order = "";
|
|
|
|
String order = "";
|
|
|
|
@ -51,13 +54,16 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
_tabController = new TabController(
|
|
|
|
_tabController = new TabController(
|
|
|
|
length: 4,
|
|
|
|
length: 4,
|
|
|
|
vsync: this,
|
|
|
|
vsync: this,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// initialIndex: 1
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return BaseView<OrderModelViewModel>(
|
|
|
|
return BaseView<OrderModelViewModel>(
|
|
|
|
onModelReady: (model) => model.getOrder(widget.customerID, widget.customerGUID, pageID),
|
|
|
|
onModelReady: (model) =>
|
|
|
|
|
|
|
|
model.getOrder(widget.customerID, widget.customerGUID, pageID),
|
|
|
|
builder: (_, model, wi) => AppScaffold(
|
|
|
|
builder: (_, model, wi) => AppScaffold(
|
|
|
|
appBarTitle: TranslationBase.of(context).order,
|
|
|
|
appBarTitle: TranslationBase.of(context).order,
|
|
|
|
baseViewModel: model,
|
|
|
|
baseViewModel: model,
|
|
|
|
@ -105,9 +111,12 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Widget getDeliveredOrder(OrderModelViewModel model) {
|
|
|
|
Widget getDeliveredOrder(OrderModelViewModel model) {
|
|
|
|
|
|
|
|
ProjectViewModel projectViewModel = Provider.of(context);
|
|
|
|
deliveredOrderList.clear();
|
|
|
|
deliveredOrderList.clear();
|
|
|
|
for (int i = 0; i < model.orders.length; i++) {
|
|
|
|
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]);
|
|
|
|
deliveredOrderList.add(model.orders[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -131,26 +140,33 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
Navigator.push(
|
|
|
|
Navigator.push(
|
|
|
|
context,
|
|
|
|
context,
|
|
|
|
FadePage(
|
|
|
|
FadePage(
|
|
|
|
page: OrderDetailsPage(orderModel: deliveredOrderList[index]),
|
|
|
|
page: OrderDetailsPage(
|
|
|
|
|
|
|
|
orderModel:
|
|
|
|
|
|
|
|
deliveredOrderList[index]),
|
|
|
|
)).then((value) {
|
|
|
|
)).then((value) {
|
|
|
|
model.getOrder(widget.customerID, widget.customerGUID, pageID);
|
|
|
|
model.getOrder(widget.customerID,
|
|
|
|
|
|
|
|
widget.customerGUID, pageID);
|
|
|
|
getDeliveredOrder(model);
|
|
|
|
getDeliveredOrder(model);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.all(8.0),
|
|
|
|
margin: EdgeInsets.all(8.0),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.only(right: 5),
|
|
|
|
margin:
|
|
|
|
|
|
|
|
EdgeInsets.only(right: 5),
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
TranslationBase.of(context).orderNumber,
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
|
|
|
.orderNumber,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 16.0,
|
|
|
|
fontSize: 16.0,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
@ -159,7 +175,9 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
deliveredOrderList[index].id.toString(),
|
|
|
|
deliveredOrderList[index]
|
|
|
|
|
|
|
|
.id
|
|
|
|
|
|
|
|
.toString(),
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 16.0,
|
|
|
|
fontSize: 16.0,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
@ -174,9 +192,11 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.only(right: 5),
|
|
|
|
margin:
|
|
|
|
|
|
|
|
EdgeInsets.only(right: 5),
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
TranslationBase.of(context).orderDate,
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
|
|
|
.orderDate,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 14.0,
|
|
|
|
fontSize: 14.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -184,7 +204,10 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
deliveredOrderList[index].createdOnUtc.toString().substring(0, 10),
|
|
|
|
deliveredOrderList[index]
|
|
|
|
|
|
|
|
.createdOnUtc
|
|
|
|
|
|
|
|
.toString()
|
|
|
|
|
|
|
|
.substring(0, 10),
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 14.0,
|
|
|
|
fontSize: 14.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -198,7 +221,9 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.all(8.0),
|
|
|
|
margin: EdgeInsets.all(8.0),
|
|
|
|
child: SvgPicture.asset(
|
|
|
|
child: SvgPicture.asset(
|
|
|
|
languageID == "ar" ? 'assets/images/pharmacy/arrow_left.svg' : 'assets/images/pharmacy/arrow_right.svg',
|
|
|
|
projectViewModel.isArabic
|
|
|
|
|
|
|
|
? 'assets/images/pharmacy/arrow_left.svg'
|
|
|
|
|
|
|
|
: 'assets/images/pharmacy/arrow_right.svg',
|
|
|
|
height: 20,
|
|
|
|
height: 20,
|
|
|
|
width: 20,
|
|
|
|
width: 20,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -214,11 +239,14 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
endIndent: 0,
|
|
|
|
endIndent: 0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8),
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
padding: EdgeInsets.only(left: 13.0, right: 13.0),
|
|
|
|
left: 8, right: 8, top: 1, bottom: 8),
|
|
|
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
|
|
|
left: 13.0, right: 13.0),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border.all(
|
|
|
|
border: Border.all(
|
|
|
|
color: Colors.blue[700],
|
|
|
|
color: Colors.blue[700],
|
|
|
|
@ -226,12 +254,23 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
width: 5.0,
|
|
|
|
width: 5.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
color: Colors.blue[700],
|
|
|
|
color: Colors.blue[700],
|
|
|
|
borderRadius: BorderRadius.circular(30.0)),
|
|
|
|
borderRadius: BorderRadius.circular(
|
|
|
|
child: deliveredOrderList[index].orderStatusId == 30 || deliveredOrderList[index].orderStatusId == 997 || deliveredOrderList[index].orderStatusId == 994
|
|
|
|
30.0)),
|
|
|
|
|
|
|
|
child: deliveredOrderList[
|
|
|
|
|
|
|
|
index]
|
|
|
|
|
|
|
|
.orderStatusId ==
|
|
|
|
|
|
|
|
30 ||
|
|
|
|
|
|
|
|
deliveredOrderList[index]
|
|
|
|
|
|
|
|
.orderStatusId ==
|
|
|
|
|
|
|
|
997 ||
|
|
|
|
|
|
|
|
deliveredOrderList[index]
|
|
|
|
|
|
|
|
.orderStatusId ==
|
|
|
|
|
|
|
|
994
|
|
|
|
// deliveredOrderList[index].orderStatusId == 30
|
|
|
|
// deliveredOrderList[index].orderStatusId == 30
|
|
|
|
? Text(
|
|
|
|
? Text(
|
|
|
|
// deliveredOrderList[0].orderStatus.toString().substring(12),
|
|
|
|
// deliveredOrderList[0].orderStatus.toString().substring(12),
|
|
|
|
TranslationBase.of(context).deliveredOrder,
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
|
|
|
.deliveredOrder,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
fontSize: 15.0,
|
|
|
|
fontSize: 15.0,
|
|
|
|
@ -239,7 +278,13 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: Text(
|
|
|
|
: Text(
|
|
|
|
languageID == "ar" ? deliveredOrderList[index].orderStatusn.toString() : deliveredOrderList[index].orderStatus.toString(),
|
|
|
|
languageID == "ar"
|
|
|
|
|
|
|
|
? deliveredOrderList[index]
|
|
|
|
|
|
|
|
.orderStatusn
|
|
|
|
|
|
|
|
.toString()
|
|
|
|
|
|
|
|
: deliveredOrderList[index]
|
|
|
|
|
|
|
|
.orderStatus
|
|
|
|
|
|
|
|
.toString(),
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
fontSize: 15.0,
|
|
|
|
fontSize: 15.0,
|
|
|
|
@ -247,7 +292,8 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
)),
|
|
|
|
Container(
|
|
|
|
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(
|
|
|
|
child: Column(
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
@ -256,7 +302,9 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.only(left: 5),
|
|
|
|
margin: EdgeInsets.only(left: 5),
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
deliveredOrderList[index].orderTotal.toString(),
|
|
|
|
deliveredOrderList[index]
|
|
|
|
|
|
|
|
.orderTotal
|
|
|
|
|
|
|
|
.toString(),
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 16.0,
|
|
|
|
fontSize: 16.0,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
@ -282,7 +330,9 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
deliveredOrderList[index].productCount.toString(),
|
|
|
|
deliveredOrderList[index]
|
|
|
|
|
|
|
|
.productCount
|
|
|
|
|
|
|
|
.toString(),
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 14.0,
|
|
|
|
fontSize: 14.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -291,7 +341,8 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.only(left: 5),
|
|
|
|
margin: EdgeInsets.only(left: 5),
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
TranslationBase.of(context).itemsNo,
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
|
|
|
.itemsNo,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 14.0,
|
|
|
|
fontSize: 14.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -340,12 +391,17 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Widget getProcessingOrder(OrderModelViewModel model) {
|
|
|
|
Widget getProcessingOrder(OrderModelViewModel model) {
|
|
|
|
|
|
|
|
ProjectViewModel projectViewModel = Provider.of(context);
|
|
|
|
processingOrderList.clear();
|
|
|
|
processingOrderList.clear();
|
|
|
|
for (int i = 0; i < model.orders.length; i++) {
|
|
|
|
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]);
|
|
|
|
processingOrderList.add(model.orders[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
_tabController.index = 1;
|
|
|
|
return Container(
|
|
|
|
return Container(
|
|
|
|
width: MediaQuery.of(context).size.width,
|
|
|
|
width: MediaQuery.of(context).size.width,
|
|
|
|
child: processingOrderList.length != 0
|
|
|
|
child: processingOrderList.length != 0
|
|
|
|
@ -363,26 +419,40 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
InkWell(
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
Navigator.push(context, FadePage(page: OrderDetailsPage(orderModel: processingOrderList[index]))).then((value) {
|
|
|
|
Navigator.push(
|
|
|
|
model.getOrder(widget.customerID, widget.customerGUID, pageID).then((value) {
|
|
|
|
context,
|
|
|
|
|
|
|
|
FadePage(
|
|
|
|
|
|
|
|
page: OrderDetailsPage(
|
|
|
|
|
|
|
|
orderModel:
|
|
|
|
|
|
|
|
processingOrderList[
|
|
|
|
|
|
|
|
index])))
|
|
|
|
|
|
|
|
.then((value) {
|
|
|
|
|
|
|
|
model
|
|
|
|
|
|
|
|
.getOrder(widget.customerID,
|
|
|
|
|
|
|
|
widget.customerGUID, pageID)
|
|
|
|
|
|
|
|
.then((value) {
|
|
|
|
getProcessingOrder(model);
|
|
|
|
getProcessingOrder(model);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.all(8.0),
|
|
|
|
margin: EdgeInsets.all(8.0),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.only(right: 5),
|
|
|
|
margin:
|
|
|
|
|
|
|
|
EdgeInsets.only(right: 5),
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
TranslationBase.of(context).orderNumber,
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
|
|
|
.orderNumber,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 16.0,
|
|
|
|
fontSize: 16.0,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
@ -391,7 +461,9 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
processingOrderList[index].id.toString(),
|
|
|
|
processingOrderList[index]
|
|
|
|
|
|
|
|
.id
|
|
|
|
|
|
|
|
.toString(),
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 16.0,
|
|
|
|
fontSize: 16.0,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
@ -406,9 +478,11 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.only(right: 5),
|
|
|
|
margin:
|
|
|
|
|
|
|
|
EdgeInsets.only(right: 5),
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
TranslationBase.of(context).orderDate,
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
|
|
|
.orderDate,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 14.0,
|
|
|
|
fontSize: 14.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -416,7 +490,10 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
processingOrderList[index].createdOnUtc.toString().substring(0, 10),
|
|
|
|
processingOrderList[index]
|
|
|
|
|
|
|
|
.createdOnUtc
|
|
|
|
|
|
|
|
.toString()
|
|
|
|
|
|
|
|
.substring(0, 10),
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 14.0,
|
|
|
|
fontSize: 14.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -430,7 +507,9 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.all(8.0),
|
|
|
|
margin: EdgeInsets.all(8.0),
|
|
|
|
child: SvgPicture.asset(
|
|
|
|
child: SvgPicture.asset(
|
|
|
|
languageID == "ar" ? 'assets/images/pharmacy/arrow_left.svg' : 'assets/images/pharmacy/arrow_right.svg',
|
|
|
|
projectViewModel.isArabic
|
|
|
|
|
|
|
|
? 'assets/images/pharmacy/arrow_left.svg'
|
|
|
|
|
|
|
|
: 'assets/images/pharmacy/arrow_right.svg',
|
|
|
|
height: 20,
|
|
|
|
height: 20,
|
|
|
|
width: 20,
|
|
|
|
width: 20,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -446,11 +525,14 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
endIndent: 0,
|
|
|
|
endIndent: 0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8),
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
padding: EdgeInsets.only(left: 13.0, right: 13.0),
|
|
|
|
left: 8, right: 8, top: 1, bottom: 8),
|
|
|
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
|
|
|
left: 13.0, right: 13.0),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border.all(
|
|
|
|
border: Border.all(
|
|
|
|
color: Colors.green,
|
|
|
|
color: Colors.green,
|
|
|
|
@ -458,15 +540,26 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
width: 5.0,
|
|
|
|
width: 5.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
color: Colors.green,
|
|
|
|
color: Colors.green,
|
|
|
|
borderRadius: BorderRadius.circular(30.0)),
|
|
|
|
borderRadius: BorderRadius.circular(
|
|
|
|
child: processingOrderList[index].orderStatusId == 20 ||
|
|
|
|
30.0)),
|
|
|
|
processingOrderList[index].orderStatusId == 995 ||
|
|
|
|
child: processingOrderList[
|
|
|
|
processingOrderList[index].orderStatusId == 998 ||
|
|
|
|
index]
|
|
|
|
processingOrderList[index].orderStatusId == 999
|
|
|
|
.orderStatusId ==
|
|
|
|
|
|
|
|
20 ||
|
|
|
|
|
|
|
|
processingOrderList[index]
|
|
|
|
|
|
|
|
.orderStatusId ==
|
|
|
|
|
|
|
|
995 ||
|
|
|
|
|
|
|
|
processingOrderList[index]
|
|
|
|
|
|
|
|
.orderStatusId ==
|
|
|
|
|
|
|
|
998 ||
|
|
|
|
|
|
|
|
processingOrderList[index]
|
|
|
|
|
|
|
|
.orderStatusId ==
|
|
|
|
|
|
|
|
999
|
|
|
|
// processingOrderList[index].orderStatusId == 20
|
|
|
|
// processingOrderList[index].orderStatusId == 20
|
|
|
|
? Text(
|
|
|
|
? Text(
|
|
|
|
// deliveredOrderList[0].orderStatus.toString().substring(12),
|
|
|
|
// deliveredOrderList[0].orderStatus.toString().substring(12),
|
|
|
|
TranslationBase.of(context).processingOrder,
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
|
|
|
.processingOrder,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
fontSize: 15.0,
|
|
|
|
fontSize: 15.0,
|
|
|
|
@ -474,7 +567,13 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: Text(
|
|
|
|
: Text(
|
|
|
|
languageID == "ar" ? processingOrderList[index].orderStatusn.toString() : processingOrderList[index].orderStatus.toString(),
|
|
|
|
languageID == "ar"
|
|
|
|
|
|
|
|
? processingOrderList[index]
|
|
|
|
|
|
|
|
.orderStatusn
|
|
|
|
|
|
|
|
.toString()
|
|
|
|
|
|
|
|
: processingOrderList[index]
|
|
|
|
|
|
|
|
.orderStatus
|
|
|
|
|
|
|
|
.toString(),
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
fontSize: 15.0,
|
|
|
|
fontSize: 15.0,
|
|
|
|
@ -482,7 +581,8 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
)),
|
|
|
|
Container(
|
|
|
|
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(
|
|
|
|
child: Column(
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
@ -491,7 +591,9 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.only(left: 5),
|
|
|
|
margin: EdgeInsets.only(left: 5),
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
processingOrderList[index].orderTotal.toString(),
|
|
|
|
processingOrderList[index]
|
|
|
|
|
|
|
|
.orderTotal
|
|
|
|
|
|
|
|
.toString(),
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 16.0,
|
|
|
|
fontSize: 16.0,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
@ -517,7 +619,9 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
processingOrderList[index].productCount.toString(),
|
|
|
|
processingOrderList[index]
|
|
|
|
|
|
|
|
.productCount
|
|
|
|
|
|
|
|
.toString(),
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 14.0,
|
|
|
|
fontSize: 14.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -526,7 +630,8 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.only(left: 5),
|
|
|
|
margin: EdgeInsets.only(left: 5),
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
TranslationBase.of(context).itemsNo,
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
|
|
|
.itemsNo,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 14.0,
|
|
|
|
fontSize: 14.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -754,6 +859,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Widget getPendingOrder(OrderModelViewModel model) {
|
|
|
|
Widget getPendingOrder(OrderModelViewModel model) {
|
|
|
|
|
|
|
|
ProjectViewModel projectViewModel = Provider.of(context);
|
|
|
|
pendingOrderList.clear();
|
|
|
|
pendingOrderList.clear();
|
|
|
|
for (int i = 0; i < model.orders.length; i++) {
|
|
|
|
for (int i = 0; i < model.orders.length; i++) {
|
|
|
|
if (model.orders[i].orderStatusId == 10) {
|
|
|
|
if (model.orders[i].orderStatusId == 10) {
|
|
|
|
@ -777,38 +883,56 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
InkWell(
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
Navigator.push(context, FadePage(page: OrderDetailsPage(orderModel: pendingOrderList[index]))).then((value) {
|
|
|
|
Navigator.push(
|
|
|
|
model.getOrder(widget.customerID, widget.customerGUID, pageID).then((value) {
|
|
|
|
context,
|
|
|
|
|
|
|
|
FadePage(
|
|
|
|
|
|
|
|
page: OrderDetailsPage(
|
|
|
|
|
|
|
|
orderModel:
|
|
|
|
|
|
|
|
pendingOrderList[
|
|
|
|
|
|
|
|
index])))
|
|
|
|
|
|
|
|
.then((value) {
|
|
|
|
|
|
|
|
model
|
|
|
|
|
|
|
|
.getOrder(widget.customerID,
|
|
|
|
|
|
|
|
widget.customerGUID, pageID)
|
|
|
|
|
|
|
|
.then((value) {
|
|
|
|
getPendingOrder(model);
|
|
|
|
getPendingOrder(model);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.all(8.0),
|
|
|
|
margin: EdgeInsets.all(8.0),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.only(right: 5),
|
|
|
|
margin:
|
|
|
|
|
|
|
|
EdgeInsets.only(right: 5),
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
TranslationBase.of(context).orderNumber,
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
|
|
|
.orderNumber,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 16.0,
|
|
|
|
fontSize: 16.0,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontWeight:
|
|
|
|
|
|
|
|
FontWeight.bold,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
pendingOrderList[index].id.toString(),
|
|
|
|
pendingOrderList[index]
|
|
|
|
|
|
|
|
.id
|
|
|
|
|
|
|
|
.toString(),
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 16.0,
|
|
|
|
fontSize: 16.0,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontWeight:
|
|
|
|
|
|
|
|
FontWeight.bold,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -820,9 +944,11 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.only(right: 5),
|
|
|
|
margin:
|
|
|
|
|
|
|
|
EdgeInsets.only(right: 5),
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
TranslationBase.of(context).orderDate,
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
|
|
|
.orderDate,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 14.0,
|
|
|
|
fontSize: 14.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -830,7 +956,10 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
pendingOrderList[index].createdOnUtc.toString().substring(0, 10),
|
|
|
|
pendingOrderList[index]
|
|
|
|
|
|
|
|
.createdOnUtc
|
|
|
|
|
|
|
|
.toString()
|
|
|
|
|
|
|
|
.substring(0, 10),
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 14.0,
|
|
|
|
fontSize: 14.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -844,7 +973,9 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.all(8.0),
|
|
|
|
margin: EdgeInsets.all(8.0),
|
|
|
|
child: SvgPicture.asset(
|
|
|
|
child: SvgPicture.asset(
|
|
|
|
languageID == "ar" ? 'assets/images/pharmacy/arrow_left.svg' : 'assets/images/pharmacy/arrow_right.svg',
|
|
|
|
projectViewModel.isArabic
|
|
|
|
|
|
|
|
? 'assets/images/pharmacy/arrow_left.svg'
|
|
|
|
|
|
|
|
: 'assets/images/pharmacy/arrow_right.svg',
|
|
|
|
height: 20,
|
|
|
|
height: 20,
|
|
|
|
width: 20,
|
|
|
|
width: 20,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -860,11 +991,13 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
endIndent: 0,
|
|
|
|
endIndent: 0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.all(8.0),
|
|
|
|
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(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border.all(
|
|
|
|
border: Border.all(
|
|
|
|
color: Colors.orange[300],
|
|
|
|
color: Colors.orange[300],
|
|
|
|
@ -872,11 +1005,15 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
width: 5.0,
|
|
|
|
width: 5.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
color: Colors.orange[300],
|
|
|
|
color: Colors.orange[300],
|
|
|
|
borderRadius: BorderRadius.circular(30.0)),
|
|
|
|
borderRadius:
|
|
|
|
child: pendingOrderList[index].orderStatusId == 10
|
|
|
|
BorderRadius.circular(30.0)),
|
|
|
|
|
|
|
|
child: pendingOrderList[index]
|
|
|
|
|
|
|
|
.orderStatusId ==
|
|
|
|
|
|
|
|
10
|
|
|
|
? Text(
|
|
|
|
? Text(
|
|
|
|
// deliveredOrderList[0].orderStatus.toString().substring(12),
|
|
|
|
// deliveredOrderList[0].orderStatus.toString().substring(12),
|
|
|
|
TranslationBase.of(context).pendingOrder,
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
|
|
|
.pendingOrder,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
fontSize: 15.0,
|
|
|
|
fontSize: 15.0,
|
|
|
|
@ -884,7 +1021,13 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: Text(
|
|
|
|
: Text(
|
|
|
|
languageID == "ar" ? pendingOrderList[index].orderStatusn.toString() : pendingOrderList[index].orderStatus.toString(),
|
|
|
|
languageID == "ar"
|
|
|
|
|
|
|
|
? pendingOrderList[index]
|
|
|
|
|
|
|
|
.orderStatusn
|
|
|
|
|
|
|
|
.toString()
|
|
|
|
|
|
|
|
: pendingOrderList[index]
|
|
|
|
|
|
|
|
.orderStatus
|
|
|
|
|
|
|
|
.toString(),
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
fontSize: 15.0,
|
|
|
|
fontSize: 15.0,
|
|
|
|
@ -899,9 +1042,12 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.only(left: 5),
|
|
|
|
margin:
|
|
|
|
|
|
|
|
EdgeInsets.only(left: 5),
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
pendingOrderList[index].orderTotal.toString(),
|
|
|
|
pendingOrderList[index]
|
|
|
|
|
|
|
|
.orderTotal
|
|
|
|
|
|
|
|
.toString(),
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 16.0,
|
|
|
|
fontSize: 16.0,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
@ -909,9 +1055,11 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.only(left: 5),
|
|
|
|
margin:
|
|
|
|
|
|
|
|
EdgeInsets.only(left: 5),
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
TranslationBase.of(context).sar,
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
|
|
|
.sar,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 16.0,
|
|
|
|
fontSize: 16.0,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
@ -927,16 +1075,20 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
pendingOrderList[index].productCount.toString(),
|
|
|
|
pendingOrderList[index]
|
|
|
|
|
|
|
|
.productCount
|
|
|
|
|
|
|
|
.toString(),
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 14.0,
|
|
|
|
fontSize: 14.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.only(left: 5),
|
|
|
|
margin:
|
|
|
|
|
|
|
|
EdgeInsets.only(left: 5),
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
TranslationBase.of(context).itemsNo,
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
|
|
|
.itemsNo,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 14.0,
|
|
|
|
fontSize: 14.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -986,9 +1138,12 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Widget getCancelledOrder(OrderModelViewModel model) {
|
|
|
|
Widget getCancelledOrder(OrderModelViewModel model) {
|
|
|
|
|
|
|
|
ProjectViewModel projectViewModel = Provider.of(context);
|
|
|
|
cancelledOrderList.clear();
|
|
|
|
cancelledOrderList.clear();
|
|
|
|
for (int i = 0; i < model.orders.length; i++) {
|
|
|
|
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]);
|
|
|
|
cancelledOrderList.add(model.orders[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -1009,38 +1164,56 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
InkWell(
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
Navigator.push(context, FadePage(page: OrderDetailsPage(orderModel: cancelledOrderList[index]))).then((value) {
|
|
|
|
Navigator.push(
|
|
|
|
model.getOrder(widget.customerID, widget.customerGUID, pageID).then((value) {
|
|
|
|
context,
|
|
|
|
|
|
|
|
FadePage(
|
|
|
|
|
|
|
|
page: OrderDetailsPage(
|
|
|
|
|
|
|
|
orderModel:
|
|
|
|
|
|
|
|
cancelledOrderList[
|
|
|
|
|
|
|
|
index])))
|
|
|
|
|
|
|
|
.then((value) {
|
|
|
|
|
|
|
|
model
|
|
|
|
|
|
|
|
.getOrder(widget.customerID,
|
|
|
|
|
|
|
|
widget.customerGUID, pageID)
|
|
|
|
|
|
|
|
.then((value) {
|
|
|
|
getCancelledOrder(model);
|
|
|
|
getCancelledOrder(model);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.all(8.0),
|
|
|
|
margin: EdgeInsets.all(8.0),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.only(right: 5),
|
|
|
|
margin:
|
|
|
|
|
|
|
|
EdgeInsets.only(right: 5),
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
TranslationBase.of(context).orderNumber,
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
|
|
|
.orderNumber,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 16.0,
|
|
|
|
fontSize: 16.0,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontWeight:
|
|
|
|
|
|
|
|
FontWeight.bold,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
cancelledOrderList[index].id.toString(),
|
|
|
|
cancelledOrderList[index]
|
|
|
|
|
|
|
|
.id
|
|
|
|
|
|
|
|
.toString(),
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 16.0,
|
|
|
|
fontSize: 16.0,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontWeight:
|
|
|
|
|
|
|
|
FontWeight.bold,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -1052,9 +1225,11 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.only(right: 5),
|
|
|
|
margin:
|
|
|
|
|
|
|
|
EdgeInsets.only(right: 5),
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
TranslationBase.of(context).orderDate,
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
|
|
|
.orderDate,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 14.0,
|
|
|
|
fontSize: 14.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -1062,7 +1237,10 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
cancelledOrderList[index].createdOnUtc.toString().substring(0, 10),
|
|
|
|
cancelledOrderList[index]
|
|
|
|
|
|
|
|
.createdOnUtc
|
|
|
|
|
|
|
|
.toString()
|
|
|
|
|
|
|
|
.substring(0, 10),
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 14.0,
|
|
|
|
fontSize: 14.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -1076,7 +1254,9 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.all(8.0),
|
|
|
|
margin: EdgeInsets.all(8.0),
|
|
|
|
child: SvgPicture.asset(
|
|
|
|
child: SvgPicture.asset(
|
|
|
|
languageID == "ar" ? 'assets/images/pharmacy/arrow_left.svg' : 'assets/images/pharmacy/arrow_right.svg',
|
|
|
|
projectViewModel.isArabic
|
|
|
|
|
|
|
|
? 'assets/images/pharmacy/arrow_left.svg'
|
|
|
|
|
|
|
|
: 'assets/images/pharmacy/arrow_right.svg',
|
|
|
|
height: 20,
|
|
|
|
height: 20,
|
|
|
|
width: 20,
|
|
|
|
width: 20,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -1092,11 +1272,17 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
endIndent: 0,
|
|
|
|
endIndent: 0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8),
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
padding: EdgeInsets.only(left: 10.0, right: 10.0),
|
|
|
|
left: 8,
|
|
|
|
|
|
|
|
right: 8,
|
|
|
|
|
|
|
|
top: 1,
|
|
|
|
|
|
|
|
bottom: 8),
|
|
|
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
|
|
|
left: 10.0, right: 10.0),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border.all(
|
|
|
|
border: Border.all(
|
|
|
|
color: Colors.red[900],
|
|
|
|
color: Colors.red[900],
|
|
|
|
@ -1104,11 +1290,15 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
width: 5.0,
|
|
|
|
width: 5.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
color: Colors.red[900],
|
|
|
|
color: Colors.red[900],
|
|
|
|
borderRadius: BorderRadius.circular(30.0)),
|
|
|
|
borderRadius:
|
|
|
|
child: cancelledOrderList[index].orderStatusId == 40
|
|
|
|
BorderRadius.circular(30.0)),
|
|
|
|
|
|
|
|
child: cancelledOrderList[index]
|
|
|
|
|
|
|
|
.orderStatusId ==
|
|
|
|
|
|
|
|
40
|
|
|
|
? Text(
|
|
|
|
? Text(
|
|
|
|
// deliveredOrderList[0].orderStatus.toString().substring(12),
|
|
|
|
// deliveredOrderList[0].orderStatus.toString().substring(12),
|
|
|
|
TranslationBase.of(context).cancelledOrder,
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
|
|
|
.cancelledOrder,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
fontSize: 15.0,
|
|
|
|
fontSize: 15.0,
|
|
|
|
@ -1116,7 +1306,13 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: Text(
|
|
|
|
: Text(
|
|
|
|
languageID == "ar" ? cancelledOrderList[index].orderStatusn.toString() : cancelledOrderList[index].orderStatus.toString(),
|
|
|
|
languageID == "ar"
|
|
|
|
|
|
|
|
? cancelledOrderList[index]
|
|
|
|
|
|
|
|
.orderStatusn
|
|
|
|
|
|
|
|
.toString()
|
|
|
|
|
|
|
|
: cancelledOrderList[index]
|
|
|
|
|
|
|
|
.orderStatus
|
|
|
|
|
|
|
|
.toString(),
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
fontSize: 15.0,
|
|
|
|
fontSize: 15.0,
|
|
|
|
@ -1124,16 +1320,20 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
)),
|
|
|
|
Container(
|
|
|
|
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(
|
|
|
|
child: Column(
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.only(left: 5),
|
|
|
|
margin:
|
|
|
|
|
|
|
|
EdgeInsets.only(left: 5),
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
cancelledOrderList[index].orderTotal.toString(),
|
|
|
|
cancelledOrderList[index]
|
|
|
|
|
|
|
|
.orderTotal
|
|
|
|
|
|
|
|
.toString(),
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 16.0,
|
|
|
|
fontSize: 16.0,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
@ -1141,9 +1341,11 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.only(left: 5),
|
|
|
|
margin:
|
|
|
|
|
|
|
|
EdgeInsets.only(left: 5),
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
TranslationBase.of(context).sar,
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
|
|
|
.sar,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 16.0,
|
|
|
|
fontSize: 16.0,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
@ -1159,16 +1361,20 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
cancelledOrderList[index].productCount.toString(),
|
|
|
|
cancelledOrderList[index]
|
|
|
|
|
|
|
|
.productCount
|
|
|
|
|
|
|
|
.toString(),
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 14.0,
|
|
|
|
fontSize: 14.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.only(left: 5),
|
|
|
|
margin:
|
|
|
|
|
|
|
|
EdgeInsets.only(left: 5),
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
TranslationBase.of(context).itemsNo,
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
|
|
|
.itemsNo,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 14.0,
|
|
|
|
fontSize: 14.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|