|
|
|
@ -8,11 +8,13 @@ import 'package:diplomaticquarterapp/config/config.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/services/pharmacy_services/order_service.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/pharmacy/order/OrderDetails.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
|
|
|
|
|
|
|
|
|
class OrderPage extends StatefulWidget {
|
|
|
|
|
|
|
|
|
|
// orderList({this.customerId, this.pageId});
|
|
|
|
|
|
|
|
|
|
var languageID ;
|
|
|
|
|
@override
|
|
|
|
|
_OrderPageState createState() => _OrderPageState();
|
|
|
|
|
}
|
|
|
|
@ -21,17 +23,19 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
|
String customerId="";
|
|
|
|
|
String page_id="";
|
|
|
|
|
|
|
|
|
|
List delivered = [] ;
|
|
|
|
|
List processing = [];
|
|
|
|
|
List cancelled = [];
|
|
|
|
|
List pending = [];
|
|
|
|
|
List <OrderModel> orderList = [] ;
|
|
|
|
|
List <OrderModel> deliveredOrderList = [] ;
|
|
|
|
|
List <OrderModel> processingOrderList = [];
|
|
|
|
|
List <OrderModel> cancelledOrderList = [];
|
|
|
|
|
List <OrderModel> pendingOrderList = [];
|
|
|
|
|
|
|
|
|
|
TabController _tabController;
|
|
|
|
|
AppSharedPreferences sharedPref = AppSharedPreferences();
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
// WidgetsBinding.instance.addPostFrameCallback((_) => getOrder());
|
|
|
|
|
|
|
|
|
|
getLanguageID();
|
|
|
|
|
super.initState();
|
|
|
|
|
_tabController = new TabController(length: 4, vsync: this,);
|
|
|
|
|
}
|
|
|
|
@ -41,11 +45,8 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
|
return BaseView<OrderModelViewModel>(
|
|
|
|
|
onModelReady: (model) => model.getOrder(customerId, page_id),
|
|
|
|
|
builder: (_,model, wi )=> AppScaffold(
|
|
|
|
|
appBarTitle:(TranslationBase.of(context).order),
|
|
|
|
|
// backgroundColor: Colors.green ,
|
|
|
|
|
// centerTitle: true,
|
|
|
|
|
// title: Text(TranslationBase.of(context).order, style: TextStyle(color:Colors.white)),
|
|
|
|
|
// backgroundColor: Colors.green,
|
|
|
|
|
appBarTitle:TranslationBase.of(context).order,
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
isShowAppBar: true,
|
|
|
|
|
isPharmacy:true ,
|
|
|
|
|
body: Container(
|
|
|
|
@ -54,7 +55,6 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
|
TabBar(
|
|
|
|
|
tabs: [
|
|
|
|
|
Tab(text: TranslationBase.of(context).delivered),
|
|
|
|
|
// Tab(text: model.order.length.toString()),
|
|
|
|
|
Tab(text: TranslationBase.of(context).processing),
|
|
|
|
|
Tab(text: TranslationBase.of(context).pending),
|
|
|
|
|
Tab(text: TranslationBase.of(context).cancelled),
|
|
|
|
@ -87,10 +87,19 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Widget getDeliveredOrder(OrderModelViewModel model){
|
|
|
|
|
for(int i=0 ; i< model.order.length; i++){
|
|
|
|
|
if( model.order[i].orderStatusId == 30 || model.order[i].orderStatusId == 997
|
|
|
|
|
|| model.order[i].orderStatusId == 994
|
|
|
|
|
){
|
|
|
|
|
deliveredOrderList.add(model.order[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return Container(
|
|
|
|
|
width: MediaQuery.of(context).size.width,
|
|
|
|
|
child: model.order.length != 0 && model.order[0].orderStatusId == 30
|
|
|
|
|
child: model.order.length != 0
|
|
|
|
|
? SingleChildScrollView(
|
|
|
|
|
child: Column(
|
|
|
|
|
children:<Widget> [
|
|
|
|
@ -98,7 +107,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
|
scrollDirection: Axis.vertical,
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
physics: ScrollPhysics(),
|
|
|
|
|
itemCount: 2 ,
|
|
|
|
|
itemCount: deliveredOrderList.length,
|
|
|
|
|
itemBuilder: (context, index){
|
|
|
|
|
return Container(
|
|
|
|
|
child: Column(
|
|
|
|
@ -121,7 +130,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: Text(model.order[0].id.toString(),
|
|
|
|
|
child: Text(deliveredOrderList[index].id.toString(),
|
|
|
|
|
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
@ -140,7 +149,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: Text(model.order[0].createdOnUtc.toString(),
|
|
|
|
|
child: Text(deliveredOrderList[index].createdOnUtc.toString().substring(0,11),
|
|
|
|
|
style: TextStyle(fontSize: 14.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
@ -155,7 +164,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.push(context,
|
|
|
|
|
MaterialPageRoute(builder: (context) => OrderDetailsPage()));
|
|
|
|
|
MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel:deliveredOrderList[index])));
|
|
|
|
|
},
|
|
|
|
|
child: SvgPicture.asset(
|
|
|
|
|
'assets/images/pharmacy/arrow_right.svg',
|
|
|
|
@ -175,27 +184,25 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Container(
|
|
|
|
|
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],
|
|
|
|
|
style: BorderStyle.solid,
|
|
|
|
|
width: 5.0,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
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],
|
|
|
|
|
borderRadius: BorderRadius.circular(30.0)
|
|
|
|
|
),
|
|
|
|
|
child: Text(
|
|
|
|
|
model.order[0].orderStatus.toString(),
|
|
|
|
|
// TranslationBase.of(context).delivered,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontSize: 15.0,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
style: BorderStyle.solid,
|
|
|
|
|
width: 5.0,
|
|
|
|
|
),
|
|
|
|
|
color: Colors.blue[700],
|
|
|
|
|
borderRadius: BorderRadius.circular(30.0)
|
|
|
|
|
),
|
|
|
|
|
child: Text(
|
|
|
|
|
// deliveredOrderList[0].orderStatus.toString().substring(12),
|
|
|
|
|
TranslationBase.of(context).deliveredOrder,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontSize: 15.0,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
@ -208,7 +215,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(left: 5),
|
|
|
|
|
child: Text(model.order[0].orderTotal.toString(),
|
|
|
|
|
child: Text(deliveredOrderList[index].orderTotal.toString(),
|
|
|
|
|
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
@ -227,7 +234,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
child: Text('12',
|
|
|
|
|
child: Text(deliveredOrderList[index].orderItems.length.toString(),
|
|
|
|
|
style: TextStyle(fontSize: 14.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
@ -267,7 +274,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Image.asset(
|
|
|
|
|
SvgPicture.asset(
|
|
|
|
|
'assets/images/pharmacy/empty_box.svg'),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(top: 10.0),
|
|
|
|
@ -284,189 +291,391 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget getProcessingOrder(OrderModelViewModel model){
|
|
|
|
|
for(int i=0 ; i< model.order.length; i++){
|
|
|
|
|
if( model.order[i].orderStatusId == 20 || model.order[i].orderStatusId == 995 ||
|
|
|
|
|
model.order[i].orderStatusId == 998 || model.order[i].orderStatusId == 999){
|
|
|
|
|
processingOrderList.add(model.order[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return Container(
|
|
|
|
|
child: model.order.length != 0 && model.order[0].orderStatusId == 20
|
|
|
|
|
? SingleChildScrollView(
|
|
|
|
|
child: Column(
|
|
|
|
|
width: MediaQuery.of(context).size.width,
|
|
|
|
|
child: model.order.length != 0
|
|
|
|
|
? SingleChildScrollView(
|
|
|
|
|
child: Column(
|
|
|
|
|
children:<Widget> [
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children:<Widget> [
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.all(8),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children:<Widget> [
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(right: 5),
|
|
|
|
|
child: Text(TranslationBase.of(context).orderNumber,
|
|
|
|
|
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: Text(model.order[0].id.toString(),
|
|
|
|
|
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 5,),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(right: 5),
|
|
|
|
|
child: Text(TranslationBase.of(context).orderDate,
|
|
|
|
|
style: TextStyle(fontSize: 14.0,
|
|
|
|
|
ListView.builder(
|
|
|
|
|
scrollDirection: Axis.vertical,
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
physics: ScrollPhysics(),
|
|
|
|
|
itemCount: processingOrderList.length,
|
|
|
|
|
itemBuilder: (context, index){
|
|
|
|
|
return Container(
|
|
|
|
|
child: Column(
|
|
|
|
|
children:<Widget> [
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children:<Widget> [
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.all(8.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children:<Widget> [
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(right: 5),
|
|
|
|
|
child: Text(TranslationBase.of(context).orderNumber,
|
|
|
|
|
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: Text(processingOrderList[index].id.toString(),
|
|
|
|
|
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 5,),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(right: 5),
|
|
|
|
|
child: Text(TranslationBase.of(context).orderDate,
|
|
|
|
|
style: TextStyle(fontSize: 14.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: Text(processingOrderList[index].createdOnUtc.toString().substring(0,11),
|
|
|
|
|
style: TextStyle(fontSize: 14.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: Text(model.order[0].createdOnUtc.toString(),
|
|
|
|
|
style: TextStyle(fontSize: 14.0,
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.all(8.0),
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.push(context,
|
|
|
|
|
MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel:processingOrderList[index])));
|
|
|
|
|
},
|
|
|
|
|
child: SvgPicture.asset(
|
|
|
|
|
'assets/images/pharmacy/arrow_right.svg',
|
|
|
|
|
height: 20,
|
|
|
|
|
width: 20,),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.all(8),
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.push(context,
|
|
|
|
|
MaterialPageRoute(builder: (context) => OrderDetailsPage()));
|
|
|
|
|
},
|
|
|
|
|
child: SvgPicture.asset(
|
|
|
|
|
'assets/images/pharmacy/arrow_right.svg',
|
|
|
|
|
height: 20,
|
|
|
|
|
width: 20,),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Divider(
|
|
|
|
|
color: Colors.grey[350],
|
|
|
|
|
height: 20,
|
|
|
|
|
thickness: 1,
|
|
|
|
|
indent: 0,
|
|
|
|
|
endIndent: 0,
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Container(
|
|
|
|
|
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,
|
|
|
|
|
style: BorderStyle.solid,
|
|
|
|
|
width: 5.0,
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
color: Colors.green,
|
|
|
|
|
borderRadius: BorderRadius.circular(30.0)
|
|
|
|
|
),
|
|
|
|
|
child: Text(
|
|
|
|
|
model.order[0].orderStatus.toString(),
|
|
|
|
|
// TranslationBase.of(context).processing,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontSize: 15.0,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
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),
|
|
|
|
|
child: Text(model.order[0].orderTotal.toString(),
|
|
|
|
|
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(left: 5),
|
|
|
|
|
child: Text(TranslationBase.of(context).sar,
|
|
|
|
|
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
|
|
|
|
|
Divider(
|
|
|
|
|
color: Colors.grey[350],
|
|
|
|
|
height: 20,
|
|
|
|
|
thickness: 1,
|
|
|
|
|
indent: 0,
|
|
|
|
|
endIndent: 0,
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
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),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
border: Border.all(
|
|
|
|
|
color: Colors.green,
|
|
|
|
|
style: BorderStyle.solid,
|
|
|
|
|
width: 5.0,
|
|
|
|
|
),
|
|
|
|
|
color: Colors.green,
|
|
|
|
|
borderRadius: BorderRadius.circular(30.0)
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 5,),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
child: Text('12',
|
|
|
|
|
style: TextStyle(fontSize: 14.0,
|
|
|
|
|
child: Text(
|
|
|
|
|
processingOrderList[index].orderStatus.toString().substring(12),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontSize: 15.0,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(left: 5),
|
|
|
|
|
child: Text(TranslationBase.of(context).itemsNo,
|
|
|
|
|
style: TextStyle(fontSize: 14.0,
|
|
|
|
|
Container(
|
|
|
|
|
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),
|
|
|
|
|
child: Text(processingOrderList[index].orderTotal.toString(),
|
|
|
|
|
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(left: 5),
|
|
|
|
|
child: Text(TranslationBase.of(context).sar,
|
|
|
|
|
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 5,),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
child: Text(processingOrderList[index].orderItems.length.toString(),
|
|
|
|
|
style: TextStyle(fontSize: 14.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(left: 5),
|
|
|
|
|
child: Text(TranslationBase.of(context).itemsNo,
|
|
|
|
|
style: TextStyle(fontSize: 14.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Divider(
|
|
|
|
|
color: Colors.grey[350],
|
|
|
|
|
height: 20,
|
|
|
|
|
thickness: 8,
|
|
|
|
|
indent: 0,
|
|
|
|
|
endIndent: 0,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Divider(
|
|
|
|
|
color: Colors.grey[350],
|
|
|
|
|
height: 20,
|
|
|
|
|
thickness: 8,
|
|
|
|
|
indent: 0,
|
|
|
|
|
endIndent: 0,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: Container(
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Image.asset(
|
|
|
|
|
'assets/images/pharmacy/empty_box.svg'),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(top: 10.0),
|
|
|
|
|
child: Text(TranslationBase.of(context).noOrder,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 16.0,
|
|
|
|
|
)),
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
SvgPicture.asset(
|
|
|
|
|
'assets/images/pharmacy/empty_box.svg'),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(top: 10.0),
|
|
|
|
|
child: Text(TranslationBase.of(context).noOrder,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 16.0,
|
|
|
|
|
)),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
// return Container(
|
|
|
|
|
// child: model.order.length != 0
|
|
|
|
|
// ? SingleChildScrollView(
|
|
|
|
|
// child: Column(
|
|
|
|
|
// children:<Widget> [
|
|
|
|
|
// ListView.builder(
|
|
|
|
|
// child: Row(
|
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
// children:<Widget> [
|
|
|
|
|
// Container(
|
|
|
|
|
// margin: EdgeInsets.all(8),
|
|
|
|
|
// child: Column(
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
// children:<Widget> [
|
|
|
|
|
// Row(
|
|
|
|
|
// children: [
|
|
|
|
|
// Container(
|
|
|
|
|
// margin: EdgeInsets.only(right: 5),
|
|
|
|
|
// child: Text(TranslationBase.of(context).orderNumber,
|
|
|
|
|
// style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// Container(
|
|
|
|
|
// child: Text(processingOrderList[0].id.toString(),
|
|
|
|
|
// style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// SizedBox(
|
|
|
|
|
// height: 5,),
|
|
|
|
|
// Row(
|
|
|
|
|
// children: [
|
|
|
|
|
// Container(
|
|
|
|
|
// margin: EdgeInsets.only(right: 5),
|
|
|
|
|
// child: Text(TranslationBase.of(context).orderDate,
|
|
|
|
|
// style: TextStyle(fontSize: 14.0,
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// Container(
|
|
|
|
|
// child: Text(processingOrderList[0].createdOnUtc.toString().substring(0,11),
|
|
|
|
|
// style: TextStyle(fontSize: 14.0,
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// Container(
|
|
|
|
|
// margin: EdgeInsets.all(8),
|
|
|
|
|
// child: InkWell(
|
|
|
|
|
// onTap: () {
|
|
|
|
|
// Navigator.push(context,
|
|
|
|
|
// MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel:processingOrderList[0])));
|
|
|
|
|
// },
|
|
|
|
|
// child: SvgPicture.asset(
|
|
|
|
|
// 'assets/images/pharmacy/arrow_right.svg',
|
|
|
|
|
// height: 20,
|
|
|
|
|
// width: 20,),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// Divider(
|
|
|
|
|
// color: Colors.grey[350],
|
|
|
|
|
// height: 20,
|
|
|
|
|
// thickness: 1,
|
|
|
|
|
// indent: 0,
|
|
|
|
|
// endIndent: 0,
|
|
|
|
|
// ),
|
|
|
|
|
// Row(
|
|
|
|
|
// 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),
|
|
|
|
|
// decoration: BoxDecoration(
|
|
|
|
|
// border: Border.all(
|
|
|
|
|
// color: Colors.green,
|
|
|
|
|
// style: BorderStyle.solid,
|
|
|
|
|
// width: 5.0,
|
|
|
|
|
// ),
|
|
|
|
|
// color: Colors.green,
|
|
|
|
|
// borderRadius: BorderRadius.circular(30.0)
|
|
|
|
|
// ),
|
|
|
|
|
// child: Text( widget.languageID == "ar"
|
|
|
|
|
// ? processingOrderList[0].orderStatusn.toString()
|
|
|
|
|
// : processingOrderList[0].orderStatus.toString().substring(12),
|
|
|
|
|
//// TranslationBase.of(context).processing,
|
|
|
|
|
// style: TextStyle(
|
|
|
|
|
// color: Colors.white,
|
|
|
|
|
// fontSize: 15.0,
|
|
|
|
|
// fontWeight: FontWeight.bold,
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// Container(
|
|
|
|
|
// 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),
|
|
|
|
|
// child: Text(processingOrderList[0].orderTotal.toString(),
|
|
|
|
|
// style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// Container(
|
|
|
|
|
// margin: EdgeInsets.only(left: 5),
|
|
|
|
|
// child: Text(TranslationBase.of(context).sar,
|
|
|
|
|
// style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// SizedBox(
|
|
|
|
|
// height: 5,),
|
|
|
|
|
// Row(
|
|
|
|
|
// children: [
|
|
|
|
|
// Container(
|
|
|
|
|
// child: Text(processingOrderList[0].orderItems[0].quantity.toString(),
|
|
|
|
|
// style: TextStyle(fontSize: 14.0,
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// Container(
|
|
|
|
|
// margin: EdgeInsets.only(left: 5),
|
|
|
|
|
// child: Text(TranslationBase.of(context).itemsNo,
|
|
|
|
|
// style: TextStyle(fontSize: 14.0,
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// Divider(
|
|
|
|
|
// color: Colors.grey[350],
|
|
|
|
|
// height: 20,
|
|
|
|
|
// thickness: 8,
|
|
|
|
|
// indent: 0,
|
|
|
|
|
// endIndent: 0,
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// )
|
|
|
|
|
// : Container(
|
|
|
|
|
// child: Center(
|
|
|
|
|
// child: Column(
|
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
// children: <Widget>[
|
|
|
|
|
// SvgPicture.asset(
|
|
|
|
|
// 'assets/images/pharmacy/empty_box.svg'),
|
|
|
|
|
// Container(
|
|
|
|
|
// margin: EdgeInsets.only(top: 10.0),
|
|
|
|
|
// child: Text(TranslationBase.of(context).noOrder,
|
|
|
|
|
// style: TextStyle(
|
|
|
|
|
// fontSize: 16.0,
|
|
|
|
|
// )),
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget getPendingOrder(OrderModelViewModel model){
|
|
|
|
|
for(int i=0 ; i< model.order.length; i++){
|
|
|
|
|
if( model.order[i].orderStatusId == 10){
|
|
|
|
|
pendingOrderList.add(model.order[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return Container(
|
|
|
|
|
child: model.order.length != 0 && model.order[0].orderStatusId == 10
|
|
|
|
|
child: model.order.length != 0
|
|
|
|
|
? SingleChildScrollView(
|
|
|
|
|
child: Column(
|
|
|
|
|
children:<Widget> [
|
|
|
|
@ -474,7 +683,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
|
scrollDirection: Axis.vertical,
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
physics: ScrollPhysics(),
|
|
|
|
|
itemCount: 2 ,
|
|
|
|
|
itemCount: pendingOrderList.length ,
|
|
|
|
|
itemBuilder: (context, index){
|
|
|
|
|
return Container(
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
@ -498,7 +707,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: Text(model.order[0].id.toString(),
|
|
|
|
|
child: Text(pendingOrderList[index].id.toString(),
|
|
|
|
|
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
@ -517,7 +726,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: Text(model.order[0].createdOnUtc.toString(),
|
|
|
|
|
child: Text(pendingOrderList[index].createdOnUtc.toString().substring(0,11),
|
|
|
|
|
style: TextStyle(fontSize: 14.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
@ -532,7 +741,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.push(context,
|
|
|
|
|
MaterialPageRoute(builder: (context) => OrderDetailsPage()));
|
|
|
|
|
MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel:pendingOrderList[index])));
|
|
|
|
|
},
|
|
|
|
|
child: SvgPicture.asset(
|
|
|
|
|
'assets/images/pharmacy/arrow_right.svg',
|
|
|
|
@ -552,28 +761,29 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
child:Container(
|
|
|
|
|
margin: EdgeInsets.all(8.0),
|
|
|
|
|
padding: EdgeInsets.only(left: 13.0, right: 13.0),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
border: Border.all(
|
|
|
|
|
color: Colors.orange[300],
|
|
|
|
|
style: BorderStyle.solid,
|
|
|
|
|
width: 5.0,
|
|
|
|
|
),
|
|
|
|
|
color: Colors.orange[300],
|
|
|
|
|
borderRadius: BorderRadius.circular(30.0)
|
|
|
|
|
),
|
|
|
|
|
child: Text(
|
|
|
|
|
model.order[0].orderStatus.toString(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontSize: 15.0,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.all(8.0),
|
|
|
|
|
padding: EdgeInsets.only(left: 13.0, right: 13.0),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
border: Border.all(
|
|
|
|
|
color: Colors.orange[300],
|
|
|
|
|
style: BorderStyle.solid,
|
|
|
|
|
width: 5.0,
|
|
|
|
|
),
|
|
|
|
|
), ),
|
|
|
|
|
color: Colors.orange[300],
|
|
|
|
|
borderRadius: BorderRadius.circular(30.0)
|
|
|
|
|
),
|
|
|
|
|
child: Text(
|
|
|
|
|
widget.languageID == "ar"
|
|
|
|
|
? pendingOrderList[index].orderStatusn.toString()
|
|
|
|
|
: pendingOrderList[index].orderStatus.toString().substring(12),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontSize: 15.0,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.all(8.0),
|
|
|
|
|
child: Column(
|
|
|
|
@ -583,7 +793,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(left: 5),
|
|
|
|
|
child: Text(model.order[0].orderTotal.toString(),
|
|
|
|
|
child: Text(pendingOrderList[index].orderTotal.toString(),
|
|
|
|
|
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
@ -602,7 +812,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
child: Text('12',
|
|
|
|
|
child: Text(pendingOrderList[index].orderItems.length.toString(),
|
|
|
|
|
style: TextStyle(fontSize: 14.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
@ -644,7 +854,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Image.asset(
|
|
|
|
|
SvgPicture.asset(
|
|
|
|
|
'assets/images/pharmacy/empty_box.svg'),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(top: 10.0),
|
|
|
|
@ -662,8 +872,14 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget getCancelledOrder(OrderModelViewModel model){
|
|
|
|
|
for(int i=0 ; i< model.order.length; i++){
|
|
|
|
|
if( model.order[i].orderStatusId == 40 || model.order[i].orderStatusId == 996
|
|
|
|
|
|| model.order[i].orderStatusId == 200){
|
|
|
|
|
cancelledOrderList.add(model.order[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return Container(
|
|
|
|
|
child: model.order.length != 0 && model.order[0].orderStatusId == 40
|
|
|
|
|
child: model.order.length != 0
|
|
|
|
|
? SingleChildScrollView(
|
|
|
|
|
child: Column(
|
|
|
|
|
children:<Widget> [
|
|
|
|
@ -671,7 +887,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
|
scrollDirection: Axis.vertical,
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
physics: ScrollPhysics(),
|
|
|
|
|
itemCount: 2 ,
|
|
|
|
|
itemCount: cancelledOrderList.length,
|
|
|
|
|
itemBuilder: (context, index){
|
|
|
|
|
return Container(
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
@ -695,7 +911,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: Text(model.order[0].id.toString(),
|
|
|
|
|
child: Text(cancelledOrderList[index].id.toString(),
|
|
|
|
|
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
@ -714,7 +930,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: Text(model.order[0].createdOnUtc.toString(),
|
|
|
|
|
child: Text(cancelledOrderList[index].createdOnUtc.toString().substring(0,11),
|
|
|
|
|
style: TextStyle(fontSize: 14.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
@ -729,7 +945,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.push(context,
|
|
|
|
|
MaterialPageRoute(builder: (context) => OrderDetailsPage()));
|
|
|
|
|
MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel:cancelledOrderList[index])));
|
|
|
|
|
},
|
|
|
|
|
child: SvgPicture.asset(
|
|
|
|
|
'assets/images/pharmacy/arrow_right.svg',
|
|
|
|
@ -749,28 +965,28 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Expanded(
|
|
|
|
|
child:Container(
|
|
|
|
|
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],
|
|
|
|
|
style: BorderStyle.solid,
|
|
|
|
|
width: 5.0,
|
|
|
|
|
),
|
|
|
|
|
color: Colors.red[900],
|
|
|
|
|
borderRadius: BorderRadius.circular(30.0)
|
|
|
|
|
),
|
|
|
|
|
child: Text(
|
|
|
|
|
model.order[0].orderStatus.toString(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontSize: 15.0,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
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],
|
|
|
|
|
style: BorderStyle.solid,
|
|
|
|
|
width: 5.0,
|
|
|
|
|
),
|
|
|
|
|
), ),
|
|
|
|
|
color: Colors.red[900],
|
|
|
|
|
borderRadius: BorderRadius.circular(30.0)
|
|
|
|
|
),
|
|
|
|
|
child: Text( widget.languageID == "ar"
|
|
|
|
|
? cancelledOrderList[index].orderStatusn.toString()
|
|
|
|
|
: cancelledOrderList[index].orderStatus.toString().substring(12),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontSize: 15.0,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8),
|
|
|
|
|
child: Column(
|
|
|
|
@ -780,7 +996,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(left: 5),
|
|
|
|
|
child: Text(model.order[0].orderTotal.toString(),
|
|
|
|
|
child: Text(cancelledOrderList[index].orderTotal.toString(),
|
|
|
|
|
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
@ -799,7 +1015,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
child: Text('12',
|
|
|
|
|
child: Text(cancelledOrderList[index].orderItems.length.toString(),
|
|
|
|
|
style: TextStyle(fontSize: 14.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
@ -841,7 +1057,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Image.asset(
|
|
|
|
|
SvgPicture.asset(
|
|
|
|
|
'assets/images/pharmacy/empty_box.svg'),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(top: 10.0),
|
|
|
|
@ -856,26 +1072,17 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getLanguageID() async {
|
|
|
|
|
var languageID = await sharedPref.getString(APP_LANGUAGE);
|
|
|
|
|
setState(() {
|
|
|
|
|
widget.languageID = languageID;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// filterOrders() {
|
|
|
|
|
// for () {
|
|
|
|
|
// if (order.order_status_id === 30 || order.order_status_id === 997 || order.order_status_id === 994) { // complete
|
|
|
|
|
// this.delivered.push(order);
|
|
|
|
|
// } else if (order.order_status_id === 40 || order.order_status_id === 200 || order.order_status_id === 996) { // cancelled & order refunded
|
|
|
|
|
// this.cancelled.push(order);
|
|
|
|
|
// } else if (order.order_status_id === 10) { // Pending
|
|
|
|
|
// this.pending.push(order);
|
|
|
|
|
// } else if (order.order_status_id === 20 || order.order_status_id === 995 || order.order_status_id === 998 || order.order_status_id === 999) { // Processing
|
|
|
|
|
// this.processing.push(order);
|
|
|
|
|
// } else { // Processing & other all other status
|
|
|
|
|
// this.other.push(order);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|