Merge branch 'master' of gitlab.com:Cloud_Solution/driver-app into delivery_confirmed

# Conflicts:
#	lib/pages/delivery/information_page.dart
setting_branch
enadhilal 6 years ago
commit 5c9417ca6d

@ -28,59 +28,45 @@ const Map<String, Map<String, String>> localizedValues = {
}, },
'forgotPassword': {'en': 'Forgot Password?', 'ar': 'هل نسيت كلمة المرور ؟'}, 'forgotPassword': {'en': 'Forgot Password?', 'ar': 'هل نسيت كلمة المرور ؟'},
'login': {'en': 'Login', 'ar': 'تسجيل الدخول'}, 'login': {'en': 'Login', 'ar': 'تسجيل الدخول'},
'haveGreatDay': {'en': 'have a great day ,', 'ar': 'أتمنى لك يوما جميلا '}, 'haveGreatDay': {'en': 'have a great day,', 'ar': 'أتمنى لك يوما جميلا '},
'youHave': {'en': 'You Have', 'ar': 'يوجد لديك'}, 'youHave': {'en': 'You Have', 'ar': 'يوجد لديك'},
'deliveredPackages': {'en': 'Delivered Packages', 'ar': 'الطرود المسلمة'}, 'deliveredPackages': {'en': 'Delivered \nPackages', 'ar': 'الطرود\n المسلمة'},
'seeAll': {'en': 'See All', 'ar': 'اظهار الكل'}, 'seeAll': {'en': 'See All', 'ar': 'اظهار الكل'},
'nearestDropOffs': {'en': 'nearest drop-offs', 'ar': 'أقرب نقطة إنزال'}, 'nearestDropOffs': {'en': 'Nearest Drop-Offs', 'ar': 'أقرب نقطة إنزال'},
'undeliveredPackages': { 'undeliveredPackages': {
'en': 'Undelivered Packages', 'en': 'Undelivered\nPackages',
'ar': 'الطرود التي لم يتم تسليمها' 'ar': 'الطرود التي\n لم يتم تسليمها'
},
'deliveryInfo': {
'en': 'Delivery information',
'ar': 'معلومات الشحنة'
}, },
'deliveryInfo': {'en': 'Delivery information', 'ar': 'معلومات الشحنة'},
'confirmationSent': { 'confirmationSent': {
'en': 'Confirmation email and SMS has been sent', 'en': 'Confirmation email and SMS has been sent',
'ar': 'تم إرسال التأكيد للبرييد الإلكتروني والرسائل النصية القصيرة' 'ar': 'تم إرسال التأكيد للبرييد الإلكتروني والرسائل النصية القصيرة'
}, },
'location': { 'location': {'en': 'Location', 'ar': 'الموقع'},
'en': 'Location', 'call': {'en': 'Call', 'ar': 'اتصال'},
'ar': 'الموقع' 'sms': {'en': 'SMS', 'ar': 'رسالة نصية'},
}, 'packageContent': {'en': 'Package Content', 'ar': 'محتوى الحزمة'},
'call': { 'payment': {'en': 'Payment', 'ar': 'دفع'},
'en': 'Call', 'delivryTime': {'en': 'Delivery Time', 'ar': 'وقت التوصيل'},
'ar': 'اتصال' 'clientReached': {'en': 'Client Reached', 'ar': 'الوصول الى العميل'},
}, 'addNoteBtn': {'en': 'Add Note', 'ar': 'اضافة ملاحظة'},
'sms': { 'nextDelivery': {'en': 'Next Delivery', 'ar': 'الشحنة التالية'},
'en': 'SMS', 'scan': {'en': 'SCAN', 'ar': 'مسح'},
'ar': 'رسالة نصية' 'away': {'en': 'away', 'ar': 'مسح'},
}, 'yourDeliveryQue': {
'packageContent': { 'en': 'Your Delivery Que',
'en': 'Package Content', 'ar': 'قائمة التسليم الخاصة بك'
'ar': 'محتوى الحزمة'
},
'payment': {
'en': 'Payment',
'ar': 'دفع'
},
'delivryTime': {
'en': 'Delivery Time',
'ar': 'وقت التوصيل'
},
'clientReached': {
'en': 'Client Reached',
'ar': 'الوصول الى العميل'
}, },
'addNoteBtn': { 'toAddPackageToQue': {
'en': 'Add Note', 'en': 'To add package to que',
'ar': 'اضافة ملاحظة' 'ar': 'لإضافة حزمة إلى قائمة الانتظار'
}, },
'nextDelivery': { 'delivered': {'en': 'Delivered', 'ar': 'وصل'},
'en': 'Next Delivery', 'deliveredAccepted': {'en': 'Delivered/Accepted', 'ar': 'تم التوصيل/مقبول'},
'ar': 'الشحنة التالية' 'deliveredRejected': {'en': 'Delivered/Rejected', 'ar': 'تم التوصيل/مرفوض'},
} 'canceled': {'en': 'Canceled', 'ar': 'الغى'},
'selectAction': {'en': 'Select Action', 'ar': 'الرجاء الاختيار'},
'youHaveSelected': {'en': 'You have selected:', 'ar': 'لقد قمت باختيار:'},
'confirm': {'en': 'Confirm', 'ar': 'تأكيد'},
'areYouSure': {'en': 'Are you sure?', 'ar': 'هل أنت واثق؟'},
}; };

@ -39,9 +39,7 @@ class OrdersService extends BaseService {
} }
} }
Future insertOrder() async { Future insertOrder(ScanQrRequestModel _scanQrRequestModel) async {
ScanQrRequestModel _scanQrRequestModel =
ScanQrRequestModel(deliveryOrderID: 1200, groupID: 0);
hasError = false; hasError = false;
try { try {
await baseAppClient.post(SCAN_QR, await baseAppClient.post(SCAN_QR,

@ -13,7 +13,7 @@ class BaseViewModel extends ChangeNotifier {
String error = ""; String error = "";
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
BaseViewModel(){ BaseViewModel() {
getUser(); getUser();
} }

@ -1,6 +1,7 @@
import 'package:driverapp/core/enum/viewstate.dart'; import 'package:driverapp/core/enum/viewstate.dart';
import 'package:driverapp/core/model/orders/pending_orders_res_model.dart'; import 'package:driverapp/core/model/orders/pending_orders_res_model.dart';
import 'package:driverapp/core/model/orders/update_order_status_request_model.dart'; import 'package:driverapp/core/model/orders/update_order_status_request_model.dart';
import 'package:driverapp/core/model/scan_qr/scan_qr_request_model.dart';
import 'package:driverapp/core/service/orders_service.dart'; import 'package:driverapp/core/service/orders_service.dart';
import '../../locator.dart'; import '../../locator.dart';
@ -22,9 +23,9 @@ class OrdersViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future insertOrder() async { Future insertOrder(ScanQrRequestModel _scanQrRequestModel) async {
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
await _OrdersService.insertOrder(); await _OrdersService.insertOrder(_scanQrRequestModel);
if (_OrdersService.hasError) { if (_OrdersService.hasError) {
error = _OrdersService.error; error = _OrdersService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
@ -32,7 +33,6 @@ class OrdersViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future updateOrderStatus( Future updateOrderStatus(
UpdateOrderStatusRequestModel updateOrderStatusRequestModel) async { UpdateOrderStatusRequestModel updateOrderStatusRequestModel) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);

@ -1,5 +1,6 @@
import 'package:barcode_scan/platform_wrapper.dart'; import 'package:barcode_scan/platform_wrapper.dart';
import 'package:driverapp/core/enum/viewstate.dart'; import 'package:driverapp/core/enum/viewstate.dart';
import 'package:driverapp/core/model/scan_qr/scan_qr_request_model.dart';
import 'package:driverapp/core/viewModels/orders_view_model.dart'; import 'package:driverapp/core/viewModels/orders_view_model.dart';
import 'package:driverapp/pages/delivery/information_page.dart'; import 'package:driverapp/pages/delivery/information_page.dart';
import 'package:driverapp/pages/orders/pending_orders_page.dart'; import 'package:driverapp/pages/orders/pending_orders_page.dart';
@ -10,9 +11,13 @@ import 'package:driverapp/widgets/others/network_base_view.dart';
import 'package:driverapp/widgets/others/rounded_container.dart'; import 'package:driverapp/widgets/others/rounded_container.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:driverapp/widgets/data_display/circle-container.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import '../base/base_view.dart'; import '../base/base_view.dart';
import 'package:driverapp/config/shared_pref_kay.dart'; import 'package:driverapp/config/shared_pref_kay.dart';
import 'package:driverapp/uitl/translations_delegate_base.dart';
class DashboardScreen extends StatefulWidget { class DashboardScreen extends StatefulWidget {
@override @override
@ -44,7 +49,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Text( Text(
'Have a great day,', TranslationBase.of(context).haveGreatDay,
style: TextStyle( style: TextStyle(
fontSize: 14.5, fontSize: 14.5,
color: Color(0xff636363), color: Color(0xff636363),
@ -53,7 +58,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
Padding( Padding(
padding: EdgeInsets.only(top: 4.5), padding: EdgeInsets.only(top: 4.5),
child: Text( child: Text(
'Driver Name', 'Drive Name',
//model.user.userName,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
fontSize: 25.0), fontSize: 25.0),
@ -114,7 +120,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
MainAxisAlignment.spaceEvenly, MainAxisAlignment.spaceEvenly,
children: <Widget>[ children: <Widget>[
Text( Text(
'You Have', TranslationBase.of(context).youHave,
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 10.0), fontSize: 10.0),
@ -126,7 +132,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
fontSize: 25.0), fontSize: 25.0),
), ),
Text( Text(
'Undeliverd\nPackages', TranslationBase.of(context)
.undeliveredPackages,
style: TextStyle( style: TextStyle(
color: Colors.white, fontSize: 9.5), color: Colors.white, fontSize: 9.5),
) )
@ -191,7 +198,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
MainAxisAlignment.spaceEvenly, MainAxisAlignment.spaceEvenly,
children: <Widget>[ children: <Widget>[
Text( Text(
'You Have', TranslationBase.of(context).youHave,
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 10.0), fontSize: 10.0),
@ -203,7 +210,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
fontSize: 25.0), fontSize: 25.0),
), ),
Text( Text(
'Succesful\nDeliveries', TranslationBase.of(context)
.deliveredPackages,
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 10.0), fontSize: 10.0),
@ -254,14 +262,17 @@ class _DashboardScreenState extends State<DashboardScreen> {
Expanded( Expanded(
child: InkWell( child: InkWell(
child: Container( child: Container(
height: MediaQuery.of(context).size.height * 0.18, height: MediaQuery.of(context).orientation ==
Orientation.portrait
? MediaQuery.of(context).size.height * 0.18
: MediaQuery.of(context).size.height * 0.28,
width: MediaQuery.of(context).size.width * 0.50, width: MediaQuery.of(context).size.width * 0.50,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15.0), borderRadius: BorderRadius.circular(15.0),
gradient: LinearGradient(colors: [ gradient: LinearGradient(
Color(0xff48C0BC), colors: [Hexcolor("#45B7AE"), Hexcolor("#119FA9")],
Color(0xff17AFB8) ),
])), ),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[ children: <Widget>[
@ -289,18 +300,20 @@ class _DashboardScreenState extends State<DashboardScreen> {
child: Padding( child: Padding(
padding: EdgeInsets.only(top: 8.0), padding: EdgeInsets.only(top: 8.0),
child: Text( child: Text(
'SCAN', TranslationBase.of(context).scan,
style: TextStyle( style: TextStyle(
fontSize: 35.0, fontSize: 35.0,
color: Colors.white, color: Colors.white,
fontWeight: FontWeight.w400), fontWeight: FontWeight.w400,
),
), ),
), ),
), ),
Padding( Padding(
padding: EdgeInsets.only(top: 0.0), padding: EdgeInsets.only(top: 0.0),
child: Text( child: Text(
'To add package to que ', TranslationBase.of(context)
.toAddPackageToQue,
style: TextStyle( style: TextStyle(
fontSize: 15.0, fontSize: 15.0,
color: Colors.white, color: Colors.white,
@ -319,30 +332,32 @@ class _DashboardScreenState extends State<DashboardScreen> {
], ],
), ),
), ),
Padding( NetworkBaseView(
padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 1.0), baseViewModel: model,
child: Row( child: Padding(
mainAxisAlignment: MainAxisAlignment.spaceBetween, padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 1.0),
children: <Widget>[ child: Row(
Column( mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
Text( Column(
'Nearest Drop-Offs', children: <Widget>[
style: TextStyle( Text(
fontSize: 21.0, TranslationBase.of(context).nearestDropOffs,
fontWeight: FontWeight.w400, style: TextStyle(
fontSize: 21.0,
fontWeight: FontWeight.w400,
),
), ),
), ],
], ),
), Column(
Column( mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[
children: <Widget>[ InkWell(
InkWell(
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Text( Text(
'See All', TranslationBase.of(context).seeAll,
style: TextStyle( style: TextStyle(
fontSize: 14.5, color: Color(0xff42B6AD)), fontSize: 14.5, color: Color(0xff42B6AD)),
), ),
@ -354,13 +369,15 @@ class _DashboardScreenState extends State<DashboardScreen> {
], ],
), ),
onTap: () => Navigator.push( onTap: () => Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => OrdersListScreen()), builder: (context) => OrdersListScreen()),
)), ),
], ),
), ],
], ),
],
),
), ),
), ),
NetworkBaseView( NetworkBaseView(
@ -377,7 +394,10 @@ class _DashboardScreenState extends State<DashboardScreen> {
child: InkWell( child: InkWell(
child: RoundedContainer( child: RoundedContainer(
raduis: 25.0, raduis: 25.0,
height: MediaQuery.of(context).size.height * 0.109, height: MediaQuery.of(context).orientation ==
Orientation.portrait
? MediaQuery.of(context).size.height * 0.109
: MediaQuery.of(context).size.height * 0.209,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
@ -385,18 +405,35 @@ class _DashboardScreenState extends State<DashboardScreen> {
flex: 1, flex: 1,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Padding( Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 10.0, bottom: 5.0, top: 10.0), left: 15.0, top: 14.0),
child: Image.asset( child: Image.asset(
'assets/images/location.png', 'assets/images/location.png',
height: height: MediaQuery.of(context)
MediaQuery.of(context).size.height * .orientation ==
0.06, Orientation.portrait
width: ? MediaQuery.of(context)
MediaQuery.of(context).size.width * .size
0.05, .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,
), ),
) )
], ],
@ -404,13 +441,13 @@ class _DashboardScreenState extends State<DashboardScreen> {
), ),
if (model.orders.length != 0) if (model.orders.length != 0)
Expanded( Expanded(
flex: 3, flex: 5,
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Padding( Padding(
padding: EdgeInsets.only(top: 10.0), padding: EdgeInsets.only(top: 20.0),
child: Text( child: Text(
model.orders[index].firstName + model.orders[index].firstName +
' ' + ' ' +
@ -437,31 +474,17 @@ class _DashboardScreenState extends State<DashboardScreen> {
), ),
), ),
Padding( Padding(
padding: EdgeInsets.all(10.0), padding: EdgeInsets.all(8.0),
child: Column( child: CircleContainer(
mainAxisAlignment: MainAxisAlignment.center, child: Text(
children: <Widget>[ model.orders[index].distanceInKilometers
Expanded( .toString() +
child: CircleAvatar( ' K.m\naway',
backgroundColor: Color(0xff707070), style: TextStyle(
radius: 28.0, color: Color(0xff42B6AD),
child: CircleAvatar( fontWeight: FontWeight.w800,
backgroundColor: Colors.white, fontStyle: FontStyle.normal),
maxRadius: 25.0, ),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
'3 K.m \n away',
style: TextStyle(
color: Color(0xff30B7B9),
fontSize: 10.5,
fontWeight: FontWeight.w400),
),
),
),
),
)
],
), ),
), ),
], ],
@ -493,8 +516,10 @@ class _DashboardScreenState extends State<DashboardScreen> {
var result = await BarcodeScanner.scan(); var result = await BarcodeScanner.scan();
// if (result.rawContent == "") { // if (result.rawContent == "") {
List<String> listOfParams = result.rawContent.split(','); List<String> listOfParams = result.rawContent.split(',');
ScanQrRequestModel _scanQrRequestModel = ScanQrRequestModel(
deliveryOrderID: int.parse(listOfParams[0]), groupID: 0);
String patientType = "1"; String patientType = "1";
await model.insertOrder(); await model.insertOrder(_scanQrRequestModel);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error); Utils.showErrorToast(model.error);
} else { } else {

File diff suppressed because one or more lines are too long

@ -1,10 +1,11 @@
import 'package:driverapp/core/viewModels/orders_view_model.dart'; import 'package:driverapp/core/viewModels/orders_view_model.dart';
import 'package:driverapp/pages/delivery/information_page.dart'; import 'package:driverapp/pages/delivery/information_page.dart';
import 'package:driverapp/widgets/data_display/circle-container.dart';
import 'package:driverapp/widgets/others/app_scaffold_widget.dart'; import 'package:driverapp/widgets/others/app_scaffold_widget.dart';
import 'package:driverapp/widgets/others/rounded_container.dart'; import 'package:driverapp/widgets/others/rounded_container.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:driverapp/uitl/translations_delegate_base.dart';
import '../base/base_view.dart'; import '../base/base_view.dart';
class OrdersListScreen extends StatefulWidget { class OrdersListScreen extends StatefulWidget {
@ -20,7 +21,7 @@ class _OrdersListScreenState extends State<OrdersListScreen> {
builder: (BuildContext context, OrdersViewModel model, Widget child) => builder: (BuildContext context, OrdersViewModel model, Widget child) =>
AppScaffold( AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: 'Your Delivery Que', appBarTitle: TranslationBase.of(context).yourDeliveryQue,
titleColor: Colors.black, titleColor: Colors.black,
body: Column( body: Column(
children: <Widget>[ children: <Widget>[
@ -35,7 +36,10 @@ class _OrdersListScreenState extends State<OrdersListScreen> {
child: InkWell( child: InkWell(
child: RoundedContainer( child: RoundedContainer(
raduis: 25.0, raduis: 25.0,
height: MediaQuery.of(context).size.height * 0.109, height: MediaQuery.of(context).orientation ==
Orientation.portrait
? MediaQuery.of(context).size.height * 0.109
: MediaQuery.of(context).size.height * 0.209,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
@ -43,17 +47,27 @@ class _OrdersListScreenState extends State<OrdersListScreen> {
flex: 1, flex: 1,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Padding( Padding(
padding: EdgeInsets.only( padding:
left: 10.0, bottom: 5.0, top: 10.0), EdgeInsets.only(left: 15.0, top: 14.0),
child: Image.asset( child: Image.asset(
'assets/images/location.png', 'assets/images/location.png',
height: height: MediaQuery.of(context)
MediaQuery.of(context).size.height * .orientation ==
0.06, Orientation.portrait
width: MediaQuery.of(context).size.width * ? MediaQuery.of(context).size.height *
0.05, 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,
), ),
) )
], ],
@ -61,12 +75,12 @@ class _OrdersListScreenState extends State<OrdersListScreen> {
), ),
if (model.orders.length != 0) if (model.orders.length != 0)
Expanded( Expanded(
flex: 3, flex: 5,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Padding( Padding(
padding: EdgeInsets.only(top: 10.0), padding: EdgeInsets.only(top: 20.0),
child: Text( child: Text(
model.orders[index].firstName + model.orders[index].firstName +
' ' + ' ' +
@ -84,7 +98,7 @@ class _OrdersListScreenState extends State<OrdersListScreen> {
), ),
Expanded( Expanded(
child: Text( child: Text(
'Olaya ST, Behind kfc next to king , ', 'Olaya ST, Behind kfc next to king',
style: style:
TextStyle(color: Color(0xff636363)), TextStyle(color: Color(0xff636363)),
), ),
@ -93,31 +107,17 @@ class _OrdersListScreenState extends State<OrdersListScreen> {
), ),
), ),
Padding( Padding(
padding: EdgeInsets.all(10.0), padding: EdgeInsets.all(8.0),
child: Column( child: CircleContainer(
mainAxisAlignment: MainAxisAlignment.center, child: Text(
children: <Widget>[ model.orders[index].distanceInKilometers
Expanded( .toString() +
child: CircleAvatar( ' K.m\naway',
backgroundColor: Colors.black45, style: TextStyle(
radius: 28.0, color: Color(0xff42B6AD),
child: CircleAvatar( fontWeight: FontWeight.w800,
backgroundColor: Colors.white, fontStyle: FontStyle.normal),
maxRadius: 25.0, ),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
'3 K.m \n away',
style: TextStyle(
color: Color(0xff30B7B9),
fontSize: 10.5,
fontWeight: FontWeight.w400),
),
),
),
),
)
],
), ),
), ),
], ],

@ -103,6 +103,30 @@ class TranslationBase {
String get confirmationSent => String get confirmationSent =>
localizedValues['confirmationSent'][locale.languageCode]; localizedValues['confirmationSent'][locale.languageCode];
String get yourDeliveryQue =>
localizedValues['yourDeliveryQue'][locale.languageCode];
String get toAddPackageToQue =>
localizedValues['toAddPackageToQue'][locale.languageCode];
String get delivered => localizedValues['delivered'][locale.languageCode];
String get deliveredAccepted =>
localizedValues['deliveredAccepted'][locale.languageCode];
String get deliveredRejected =>
localizedValues['deliveredRejected'][locale.languageCode];
String get canceled => localizedValues['canceled'][locale.languageCode];
String get selectAction =>
localizedValues['selectAction'][locale.languageCode];
String get youHaveSelected =>
localizedValues['youHaveSelected'][locale.languageCode];
String get confirm => localizedValues['confirm'][locale.languageCode];
String get areYouSure => localizedValues['areYouSure'][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -15,16 +15,18 @@ class ActionSheetButton extends StatelessWidget {
onTap: onTap, onTap: onTap,
child: Container( child: Container(
height: SizeConfig.isMobilePortrait height: SizeConfig.isMobilePortrait
? MediaQuery.of(context).size.height * 0.07 ? MediaQuery.of(context).size.height * 0.08
: MediaQuery.of(context).size.height * 0.14, : MediaQuery.of(context).size.height * 0.14,
decoration: BoxDecoration( decoration: BoxDecoration(boxShadow: [
border: Border.all(color: Colors.blue), BoxShadow(
borderRadius: BorderRadius.circular(6), color: Hexcolor("#DBE5E6"),
gradient: LinearGradient(colors: [ spreadRadius: 15,
Hexcolor('#DCE6E8'), blurRadius: 15,
Hexcolor('#FFFFFF'), offset: Offset(0, 7),
], begin: Alignment.topLeft),
), // changes position of shadow
),
], borderRadius: BorderRadius.circular(15), color: Colors.white),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
@ -61,7 +63,9 @@ class ActionSheetButton extends StatelessWidget {
padding: EdgeInsets.only(top: 5.0), padding: EdgeInsets.only(top: 5.0),
child: Text( child: Text(
label, label,
style: TextStyle(fontSize: 18.0), style: TextStyle(fontSize: 22.0,
fontFamily: "Metropolis-Bold",
color: Hexcolor("##1A1818")),
), ),
) )
], ],

@ -12,7 +12,7 @@ class CustomBottomSheet extends StatelessWidget {
return Container( return Container(
padding: EdgeInsets.symmetric(vertical: 12.0), padding: EdgeInsets.symmetric(vertical: 12.0),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Hexcolor("#FEFEFE"), color: Colors.white,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: Radius.circular(30.0), topLeft: Radius.circular(30.0),
topRight: Radius.circular(30.0), topRight: Radius.circular(30.0),

@ -191,8 +191,17 @@ class _SecondaryButtonState extends State<SecondaryButton>
height: MediaQuery.of(context).size.width * 2.2, height: MediaQuery.of(context).size.width * 2.2,
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.circle, shape: BoxShape.circle,
color: widget.color != null ? widget.color : Hexcolor( gradient: widget.color != null
"#1CA4AA"), ? null
: LinearGradient(
colors: [
Hexcolor("#45B7AE"),
Hexcolor("#119FA9")
],
),
color: widget.color != null
? widget.color
: Hexcolor("#000000"),
), ),
), ),
), ),
@ -201,10 +210,10 @@ class _SecondaryButtonState extends State<SecondaryButton>
padding: widget.iconOnly padding: widget.iconOnly
? EdgeInsets.symmetric(vertical: 4.0, horizontal: 5.0) ? EdgeInsets.symmetric(vertical: 4.0, horizontal: 5.0)
: EdgeInsets.only( : EdgeInsets.only(
top: widget.small ? 8.0 : 12.0, top: widget.small ? 8.0 : 16.0,
bottom: widget.small ? 6.0 : 12.0, bottom: widget.small ? 6.0 : 16.0,
left: 18.0, left: 18.0,
right: 18.0), right: 18.0),
child: Stack( child: Stack(
children: <Widget>[ children: <Widget>[
Positioned( Positioned(

@ -1,6 +1,7 @@
import 'package:driverapp/core/enum/viewstate.dart'; import 'package:driverapp/core/enum/viewstate.dart';
import 'package:driverapp/core/viewModels/orders_view_model.dart'; import 'package:driverapp/core/viewModels/orders_view_model.dart';
import 'package:driverapp/pages/base/base_view.dart'; import 'package:driverapp/pages/base/base_view.dart';
import 'package:driverapp/uitl/translations_delegate_base.dart';
import 'package:driverapp/widgets/buttons/secondary_button.dart'; import 'package:driverapp/widgets/buttons/secondary_button.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -34,7 +35,7 @@ class CustomDialog extends StatelessWidget {
height: 30, height: 30,
), ),
Text( Text(
'you have selected:', TranslationBase.of(context).youHaveSelected,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: Colors.black, color: Colors.black,
@ -54,7 +55,9 @@ class CustomDialog extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[ children: <Widget>[
Texts( Texts(
'Are you sure?', TranslationBase
.of(context)
.areYouSure,
color: Colors.black, color: Colors.black,
fontSize: 20, fontSize: 20,
), ),
@ -62,7 +65,9 @@ class CustomDialog extends StatelessWidget {
height: 10, height: 10,
), ),
SecondaryButton( SecondaryButton(
label: "Confirm", label: TranslationBase
.of(context)
.confirm,
loading: model.state == ViewState.BusyLocal, loading: model.state == ViewState.BusyLocal,
onTap: () { onTap: () {
model.setState(ViewState.BusyLocal); model.setState(ViewState.BusyLocal);
@ -73,7 +78,9 @@ class CustomDialog extends StatelessWidget {
height: 10, height: 10,
), ),
SecondaryButton( SecondaryButton(
label: "Cancel", label: TranslationBase
.of(context)
.canceled,
onTap: () { onTap: () {
model.hideBottomSheet(); model.hideBottomSheet();
Navigator.of(context).pop(); Navigator.of(context).pop();

@ -33,17 +33,16 @@ class AppScaffold extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
AppGlobal.context = context; AppGlobal.context = context;
return SafeArea( return SafeArea(
bottom: false,
child: Scaffold( child: Scaffold(
backgroundColor: appBarColor ?? Theme.of(context).scaffoldBackgroundColor, backgroundColor:
appBarColor ?? Theme.of(context).scaffoldBackgroundColor,
appBar: isShowAppBar appBar: isShowAppBar
? AppBar( ? AppBar(
elevation: 0, elevation: 0,
backgroundColor: Theme backgroundColor: Theme.of(context).appBarTheme.color,
.of(context) textTheme: TextTheme(
.appBarTheme headline6: TextStyle(
.color,
textTheme: TextTheme(
headline6: TextStyle(
color: titleColor ?? Colors.white, color: titleColor ?? Colors.white,
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold),
), ),
@ -80,6 +79,6 @@ class AppScaffold extends StatelessWidget {
} }
buildBodyWidget() { buildBodyWidget() {
return Stack(children: <Widget>[body, buildAppLoaderWidget(isLoading)]); return body;
} }
} }

Loading…
Cancel
Save