ES-185:fix issues

fix_some_issue
Elham Rababah 5 years ago
parent 9b14359cb2
commit 3bc9b4e64a

@ -27,14 +27,16 @@ const Map<String, Map<String, String>> 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<String, Map<String, String>> 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': 'لقد قمت باختيار:'},

@ -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;

@ -573,7 +573,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
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");
}

@ -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,

@ -48,6 +48,7 @@ class _DeliverdOrdersPageState extends State<DeliverdOrdersPage> {
padding: EdgeInsets.symmetric(horizontal: 12.2),
child: OrderInfoCard(
order: model.deliverdOrders[index],
showStatus: true,
onTap: () {},
));
},

@ -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: <Widget>[
Expanded(
flex: 1,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
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: <Widget>[
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: <Widget>[
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: <Widget>[
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,
),
),
),
),
],
)
],
),
),
),
),

Loading…
Cancel
Save