diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index ad8ed64..2a232e9 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -27,14 +27,16 @@ const Map> localizedValues = { 'ar': 'الرجاء إدخال اسم المستخدم وكلمة المرور لتسجيل الدخول' }, 'enterForgetIdMsg': { - 'en': 'We will send a One Time Password (OTP) to your Mobile Number to reset your password.', - 'ar': 'سنرسل كلمة مرور لمرة واحدة (OTP) إلى حسابك رقم الهاتف المحمول لإعادة تعيين كلمة المرور الخاصة بك.' + 'en': + 'We will send a One Time Password (OTP) to your Mobile Number to reset your password.', + 'ar': + 'سنرسل كلمة مرور لمرة واحدة (OTP) إلى حسابك رقم الهاتف المحمول لإعادة تعيين كلمة المرور الخاصة بك.' }, 'forgotPassword': {'en': 'Forgot Password?', 'ar': 'هل نسيت كلمة المرور ؟'}, 'login': {'en': 'Login', 'ar': 'تسجيل الدخول'}, 'haveGreatDay': {'en': 'have a great day,', 'ar': 'أتمنى لك يوما جميلا '}, 'youHave': {'en': 'You Have', 'ar': 'يوجد لديك'}, - 'deliveredPackages': {'en': 'Delivered \nPackages', 'ar': 'الطرود\n المسلمة'}, + 'deliveredPackages': {'en': 'Processed \nPackages', 'ar': 'الطرود\n المسلمة'}, 'seeAll': {'en': 'See All', 'ar': 'اظهار الكل'}, 'nearestDropOffs': {'en': 'Nearest Drop-Offs', 'ar': 'أقرب نقطة إنزال'}, 'undeliveredPackages': { @@ -67,7 +69,7 @@ const Map> localizedValues = { }, 'delivered': {'en': 'Delivered', 'ar': 'وصل'}, 'deliveredAccepted': {'en': 'Delivered/Accepted', 'ar': 'تم التوصيل/مقبول'}, - 'deliveredRejected': {'en': 'Delivered/Rejected', 'ar': 'تم التوصيل/مرفوض'}, + 'deliveredRejected': {'en': 'Rejected', 'ar': 'مرفوض'}, 'canceled': {'en': 'Canceled', 'ar': 'الغى'}, 'selectAction': {'en': 'Select Action', 'ar': 'الرجاء الاختيار'}, 'youHaveSelected': {'en': 'You have selected:', 'ar': 'لقد قمت باختيار:'}, diff --git a/lib/core/service/orders_service.dart b/lib/core/service/orders_service.dart index e95096b..9fb9c24 100644 --- a/lib/core/service/orders_service.dart +++ b/lib/core/service/orders_service.dart @@ -102,10 +102,8 @@ class OrdersService extends BaseService { onSuccess: (dynamic response, int statusCode) { isOrderStatusUpdated = response["PatientER_Delivery_IsOrderUpdated"]; - if (updateOrderStatusRequestModel.deliveryOrderStatus == 4) { listCountUnDelivered --; listCountDelivered ++; - } }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/pages/dashboard/dashboard_screen.dart b/lib/pages/dashboard/dashboard_screen.dart index 1739ea5..efc8911 100644 --- a/lib/pages/dashboard/dashboard_screen.dart +++ b/lib/pages/dashboard/dashboard_screen.dart @@ -573,7 +573,8 @@ class _DashboardScreenState extends State { if (model.state == ViewState.ErrorLocal) { Utils.showErrorToast(model.error); } else { - /// we call the service again in order to get them oreder + /// we call the service ag + /// ain in order to get them oreder await model.getPendingOrders(1); AppToast.showSuccessToast(message: "Order Added"); } diff --git a/lib/pages/delivery/information_page.dart b/lib/pages/delivery/information_page.dart index d069607..7046e15 100644 --- a/lib/pages/delivery/information_page.dart +++ b/lib/pages/delivery/information_page.dart @@ -99,39 +99,42 @@ class InformationPage extends StatelessWidget { ), ActionSheetButton( label: - TranslationBase.of(context).delivered, + TranslationBase + .of(context) + .delivered, icon: DriverApp.deliverd_icon, onTap: () { - selectAction(context, 3, model); - }, - ), - SizedBox(height: 15), - ActionSheetButton( - label: TranslationBase.of(context) - .deliveredAccepted, - icon: DriverApp.not_available, - onTap: () { - selectAction(context, 4, model); + selectAction(context, 2, model); }, ), SizedBox(height: 15), + // ActionSheetButton( + // label: TranslationBase.of(context) + // .deliveredAccepted, + // icon: DriverApp.not_available, + // onTap: () { + // selectAction(context, 4, model); + // }, + // ), + // SizedBox(height: 15), ActionSheetButton( - label: TranslationBase.of(context) + label: TranslationBase + .of(context) .deliveredRejected, icon: DriverApp.rejected_icon, onTap: () { - selectAction(context, 5, model); - }, - ), - SizedBox(height: 15), - ActionSheetButton( - label: TranslationBase.of(context).canceled, - icon: DriverApp.not_reachable_icon, - onTap: () { - selectAction(context, 6, model); + selectAction(context, 3, model); }, ), SizedBox(height: 15), + // ActionSheetButton( + // label: TranslationBase.of(context).canceled, + // icon: DriverApp.not_reachable_icon, + // onTap: () { + // selectAction(context, 6, model); + // }, + // ), + // SizedBox(height: 15), ], ), ], @@ -361,18 +364,22 @@ class InformationPage extends StatelessWidget { String orderStatusText; this._orderStatus = orderStatus; switch (orderStatus) { - case 3: - orderStatusText = TranslationBase.of(context).delivered; - break; - case 4: - orderStatusText = TranslationBase.of(context).deliveredAccepted; + case 2: + orderStatusText = TranslationBase + .of(context) + .delivered; break; - case 5: - orderStatusText = TranslationBase.of(context).deliveredRejected; - break; - case 6: - orderStatusText = TranslationBase.of(context).canceled; + // case 4: + // orderStatusText = TranslationBase.of(context).deliveredAccepted; + // break; + case 3: + orderStatusText = TranslationBase + .of(context) + .deliveredRejected; break; + // case 6: + // orderStatusText = TranslationBase.of(context).canceled; + // break; } showDialog( context: context, diff --git a/lib/pages/orders/deliverd_orders_page.dart b/lib/pages/orders/deliverd_orders_page.dart index b32d5de..63232e3 100644 --- a/lib/pages/orders/deliverd_orders_page.dart +++ b/lib/pages/orders/deliverd_orders_page.dart @@ -48,6 +48,7 @@ class _DeliverdOrdersPageState extends State { padding: EdgeInsets.symmetric(horizontal: 12.2), child: OrderInfoCard( order: model.deliverdOrders[index], + showStatus: true, onTap: () {}, )); }, diff --git a/lib/widgets/order/order_info_card.dart b/lib/widgets/order/order_info_card.dart index 12f7b59..0425ef0 100644 --- a/lib/widgets/order/order_info_card.dart +++ b/lib/widgets/order/order_info_card.dart @@ -5,10 +5,13 @@ import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; class OrderInfoCard extends StatelessWidget { - const OrderInfoCard({Key key, this.order, this.onTap}) : super(key: key); + const OrderInfoCard( + {Key key, this.order, this.onTap, this.showStatus = false}) + : super(key: key); final dynamic order; final Function onTap; + final bool showStatus; @override Widget build(BuildContext context) { @@ -18,77 +21,120 @@ class OrderInfoCard extends StatelessWidget { showShadow: true, raduis: 25.0, height: MediaQuery.of(context).orientation == Orientation.portrait - ? MediaQuery.of(context).size.height * 0.120 - : MediaQuery.of(context).size.height * 0.209, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - flex: 1, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only(left: 15.0, top: 14.0), - child: Image.asset( - 'assets/images/location.png', - height: MediaQuery.of(context).orientation == - Orientation.portrait - ? MediaQuery.of(context).size.height * 0.06 - : MediaQuery.of(context).size.height * 0.11, - width: MediaQuery.of(context).orientation == - Orientation.portrait - ? MediaQuery.of(context).size.width * 0.05 - : MediaQuery.of(context).size.width * 0.09, - ), - ) - ], - ), - ), - Expanded( - flex: 5, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + ? MediaQuery.of(context).size.height * + (showStatus ? 0.190 : 0.140) + : MediaQuery.of(context).size.height * + (showStatus ? 0.299 : 0.269), + child: FractionallySizedBox( + widthFactor: 0.98, + child: ListView( + // mainAxisAlignment: MainAxisAlignment.start, + + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Padding( - padding: EdgeInsets.only(top: 20.0), - child: Text( - Utils.formatStringToPascalCase( - order.firstName + ' ' + order.lastName), - style: TextStyle( - fontSize: 18.0, - color: Hexcolor("#343333"), - fontWeight: FontWeight.bold), - ), - ), - Text( - order.mobileNumber, - style: TextStyle( - color: Color(0xff30B7B9), - fontWeight: FontWeight.w600, - fontSize: 15.0, - ), + Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: + EdgeInsets.only(left: 15.0, top: 14.0), + child: Image.asset( + 'assets/images/location.png', + height: MediaQuery.of(context) + .orientation == + Orientation.portrait + ? MediaQuery.of(context).size.height * + 0.06 + : MediaQuery.of(context).size.height * + 0.11, + width: MediaQuery.of(context).orientation == + Orientation.portrait + ? MediaQuery.of(context).size.width * + 0.05 + : MediaQuery.of(context).size.width * + 0.09, + ), + ), + SizedBox( + width: 13, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(top: 20.0), + child: Text( + Utils.formatStringToPascalCase( + order.firstName + + ' ' + + order.lastName), + style: TextStyle( + fontSize: 18.0, + color: Hexcolor("#343333"), + fontWeight: FontWeight.bold), + ), + ), + Text( + order.mobileNumber, + style: TextStyle( + color: Color(0xff30B7B9), + fontWeight: FontWeight.w600, + fontSize: 15.0, + ), + ), + Text( + order.orderID.toString(), + style: TextStyle( + fontSize: 15.0, + fontWeight: FontWeight.w400, + letterSpacing: 8.0), + ), + ], + ), + ], + ), + ], + ) + ], ), - Expanded( - child: Text( - order.orderID.toString(), - style: TextStyle( - fontSize: 15.0, - fontWeight: FontWeight.w400, - letterSpacing: 8.0), + Padding( + padding: EdgeInsets.all(8.0), + child: DistanceInKilometers( + distanceInKilometers: order.distanceInKilometers, ), ), ], ), - ), - Padding( - padding: EdgeInsets.all(8.0), - child: DistanceInKilometers( - distanceInKilometers: order.distanceInKilometers, - ), - ), - ], + if (showStatus) + Row( + children: [ + Container( + margin: EdgeInsets.only(bottom: 8, left: 20), + color: order.statusID == 2 ? Colors.green : Colors.red, + child: Padding( + padding: const EdgeInsets.all(5.0), + child: Text( + order.description, + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.w600, + fontSize: 15.0, + ), + ), + ), + ), + ], + ) + ], + ), ), ), ),