diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 5cfdfbe..2d54262 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -11,7 +11,7 @@ const Map> localizedValues = { 'services': {'en': 'SERVICES', 'ar': 'الخدمات'}, 'mySchedule': {'en': 'My Schedule', 'ar': 'جدولي'}, 'logout': {'en': 'Logout', 'ar': 'تسجيل خروج'}, - 'booking':{'en': 'Booking','ar':'حجز'}, + 'booking': {'en': 'Booking', 'ar': 'حجز'}, 'enterId': {'en': 'User Name', 'ar': 'اسم المستخدم'}, 'pleaseEnterYourID': { 'en': 'Please enter your ', @@ -26,13 +26,19 @@ const Map> localizedValues = { 'en': 'Please insert username and password to login', 'ar': 'الرجاء إدخال اسم المستخدم وكلمة المرور لتسجيل الدخول' }, - 'forgotPassword': { - 'en': 'Forgot Password?', - 'ar': 'هل نسيت كلمة المرور ؟' + 'forgotPassword': {'en': 'Forgot Password?', 'ar': 'هل نسيت كلمة المرور ؟'}, + 'login': {'en': 'Login', 'ar': 'تسجيل الدخول'}, + 'haveGreatDay': {'en': 'have a great day ,', 'ar': 'أتمنى لك يوما جميلا '}, + 'youHave': {'en': 'You Have', 'ar': 'يوجد لديك'}, + 'deliveredPackages': {'en': 'Delivered Packages', 'ar': 'الطرود المسلمة'}, + 'seeAll': {'en': 'See All', 'ar': 'اظهار الكل'}, + 'nearestDropOffs': {'en': 'nearest drop-offs', 'ar': 'أقرب نقطة إنزال'}, + 'undeliveredPackages': { + 'en': 'Undelivered Packages', + 'ar': 'الطرود التي لم يتم تسليمها' }, - 'login': { - 'en': 'Login', - 'ar': 'تسجيل الدخول' - } - + 'away': {'en': 'away', 'ar': 'بعيدا'}, + 'scan': {'en': 'Scan', 'ar': 'مسح'}, + 'scan2': {'en': 'away', 'ar': 'بعيدا'}, + 'scanDb': {'en': 'away', 'ar': 'بعيدا'}, }; diff --git a/lib/core/model/pending_orders/pending_orders_model.dart b/lib/core/model/pending_orders/pending_orders_model.dart index c2ef9e3..782bddc 100644 --- a/lib/core/model/pending_orders/pending_orders_model.dart +++ b/lib/core/model/pending_orders/pending_orders_model.dart @@ -1,5 +1,3 @@ -import 'dart:ffi'; - class PendingOrders { int driverID; String searchKey; @@ -11,18 +9,21 @@ class PendingOrders { String firstName; String lastName; String mobileNumber; + int distanceInKilometers; - PendingOrders( - {this.driverID, - this.searchKey, - this.pageSize, - this.pageIndex, - this.tokenID, - this.userID, - this.mobileNo, - this.firstName, - this.lastName, - this.mobileNumber}); + PendingOrders({ + this.driverID, + this.searchKey, + this.pageSize, + this.pageIndex, + this.tokenID, + this.userID, + this.mobileNo, + this.firstName, + this.lastName, + this.mobileNumber, + this.distanceInKilometers, + }); PendingOrders.fromJson(Map json) { driverID = json['DriverID']; @@ -35,6 +36,7 @@ class PendingOrders { firstName = json['FirstName']; lastName = json['LastName']; mobileNumber = json['MobileNumber']; + distanceInKilometers = json['DistanceInKilometers']; } Map toJson() { diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 50835f1..d7c6e5e 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -34,9 +34,10 @@ class BaseAppClient { body['UserID'] = '${doctorProfile?.userID}'; body['TokenID'] = token; body['MobileNo'] = doctorProfile?.mobileNumber; + body['Channel'] = CHANNEL; } - body['Channel'] = CHANNEL; + print("URL : $url"); print("Body : ${json.encode(body)}"); diff --git a/lib/pages/dashboard/dashboard_screen.dart b/lib/pages/dashboard/dashboard_screen.dart index ed986ee..360618f 100644 --- a/lib/pages/dashboard/dashboard_screen.dart +++ b/lib/pages/dashboard/dashboard_screen.dart @@ -1,15 +1,16 @@ import 'package:barcode_scan/platform_wrapper.dart'; -import 'package:driverapp/config/size_config.dart'; import 'package:driverapp/core/enum/viewstate.dart'; import 'package:driverapp/core/viewModels/orders_view_model.dart'; +import 'package:driverapp/pages/delivery/information_page.dart'; +import 'package:driverapp/pages/orders/pending_orders_page.dart'; import 'package:driverapp/uitl/app_toast.dart'; import 'package:driverapp/uitl/utils.dart'; +import 'package:driverapp/widgets/others/app_scaffold_widget.dart'; +import 'package:driverapp/widgets/others/rounded_container.dart'; +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + import '../base/base_view.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:driverapp/app-icons/driver_app_icons.dart'; -import 'package:driverapp/widgets/others/rounded_container.dart'; -import 'package:driverapp/pages/orders/pending_orders_page.dart'; class DashboardScreen extends StatefulWidget { @override @@ -19,12 +20,12 @@ class DashboardScreen extends StatefulWidget { class _DashboardScreenState extends State { @override Widget build(BuildContext context) { + int orderId; return BaseView( onModelReady: (model) => model.getPendingOrders(), builder: (BuildContext context, OrdersViewModel model, Widget child) => - Scaffold( - backgroundColor: Color(0xffF4F9FA), + AppScaffold( body: Column( // mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, @@ -337,98 +338,114 @@ class _DashboardScreenState extends State { ], ), ), - Column( - children: [ - ListView.builder( - shrinkWrap: true, - scrollDirection: Axis.vertical, - itemCount: //model.orders == null ? 0 : model.orders.length, - 3, - itemBuilder: (BuildContext context, int index) { - return Padding( - padding: EdgeInsets.symmetric(horizontal: 12.2), - child: RoundedContainer( - height: MediaQuery.of(context).size.height * 0.108, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - flex: 1, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Padding( - padding: EdgeInsets.only(left: 22.0), - child: Image.asset( - 'assets/images/location.png'), - ) - ], - ), - ), - if (model.orders.length != 0) + Expanded( + child: ListView.builder( + shrinkWrap: true, + scrollDirection: Axis.vertical, + itemCount: //model.orders == null ? 0 : model.orders.length, + 3, + itemBuilder: (BuildContext context, int index) { + return Padding( + padding: EdgeInsets.symmetric(horizontal: 12.2), + child: InkWell( + child: RoundedContainer( + height: MediaQuery.of(context).size.height * 0.108, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ Expanded( - flex: 3, + flex: 1, child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, children: [ - Text( - model.orders[index].firstName + - ' ' + - model.orders[index].lastName, - style: TextStyle(fontSize: 18.0), - ), - Text( - model.orders[index].mobileNumber, - style: TextStyle( - color: Color(0xff30B7B9), - fontWeight: FontWeight.w600, - fontSize: 15.0), - ), - Expanded( - child: Text( - 'Olaya ST, Behind kfc next to king ', - style: - TextStyle(color: Colors.black45), + Padding( + padding: EdgeInsets.only(left: 22.0), + child: Image.asset( + 'assets/images/location.png', + height: MediaQuery.of(context) + .size + .height * + 0.10, + width: MediaQuery.of(context) + .size + .width * + 0.09, ), ) ], ), ), - Padding( - padding: EdgeInsets.all(10.0), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, + if (model.orders.length != 0) + Expanded( + flex: 3, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, children: [ + Text( + model.orders[index].firstName + + ' ' + + model.orders[index].lastName, + style: TextStyle(fontSize: 18.0), + ), + Text( + model.orders[index].mobileNumber, + style: TextStyle( + color: Color(0xff30B7B9), + fontWeight: FontWeight.w600, + fontSize: 15.0), + ), Expanded( + child: Text( + 'Olaya ST, Behind kfc next to king ,Olaya ST ', + style: TextStyle(color: Colors.black45), + ), + ), + ], + ), + ), + Padding( + padding: EdgeInsets.all(10.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: CircleAvatar( + backgroundColor: Colors.black45, + radius: 28.0, child: CircleAvatar( - backgroundColor: Colors.black45, - radius: 28.0, - child: CircleAvatar( - backgroundColor: Colors.white, - maxRadius: 25.1, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Text( - '3 K.m \n away', - style: TextStyle( - color: Color(0xff30B7B9), - fontSize: 12.5, - fontWeight: FontWeight.w600), - ), + backgroundColor: Colors.white, + maxRadius: 25.1, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + '3 K.m \n away', + style: TextStyle( + color: Color(0xff30B7B9), + fontSize: 12.5, + fontWeight: FontWeight.w600), ), ), ), - ) - ], - ), + ), + ) + ], ), - ], - ), + ), + ], ), - ); - }) - ], + ), + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + InformationPage(model.orders[index]))); + }, + ), + ); + }, + ), ) ], ), diff --git a/lib/pages/delivery/delivery_confirmed_page.dart b/lib/pages/delivery/delivery_confirmed_page.dart new file mode 100644 index 0000000..e7af05a --- /dev/null +++ b/lib/pages/delivery/delivery_confirmed_page.dart @@ -0,0 +1,155 @@ +import 'package:driverapp/widgets/delivery/customer_brief_card.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import '../../widgets/others/app_scaffold_widget.dart'; + +class DeliveryConfirmedPage extends StatelessWidget { + final dynamic item; + + DeliveryConfirmedPage(this.item); + + @override + Widget build(BuildContext context) { + return AppScaffold( + body: SafeArea( + child: Container( + color: Color(0xff41bdbb), + child: ListView( + children: [ + Column( + children: [ + Column( + children: [ + Container( + child: Container( + alignment: Alignment.topLeft, + child: IconButton( + color: Colors.white, + iconSize: 40, + icon: Icon(Icons.arrow_back), + onPressed: () { + Navigator.pop(context); + }, + ), + ), + ), + Container( + child: Column( + children: [ + Container( + width: 300, + height: 300, + padding: EdgeInsets.only(top:60), + decoration: BoxDecoration( + color: Colors.white10, + shape: BoxShape.circle + ), + child: Column( + children: [ + Icon( + Icons.check_circle, + color: Colors.white, + size: 60, + ), + Text( + 'Delivery Confirmed', + style: TextStyle( + color: Colors.white, + fontSize: 20, + fontWeight: FontWeight.bold), + ), + Text( + 'Confirmation email and SMS has been sent', + style: TextStyle( + color: Colors.white, + fontSize: 13, + ), + ), + ], + ), + ), + ], + ), + ), + ], + ), + + Stack( + children: [ + Container( + width: 400, + height: 500, + ), + Container( + width: 800, + height: 440, + margin: EdgeInsets.only(top: 60), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(80), + topRight: Radius.circular(80)), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + margin: EdgeInsets.only(bottom: 50), + child: Column( + children: [ + FlatButton.icon( + padding: EdgeInsets.all(8), + color: Colors.orangeAccent, + shape: RoundedRectangleBorder( + borderRadius: new BorderRadius.circular(10.0), + ), + icon: Icon( + Icons.mode_edit, + color: Colors.white, + ), + label: Text( + 'Add Note', + style: TextStyle(color: Colors.white), + ), + onPressed: () {}, + ), + SizedBox(height: 20,), + FlatButton( + color: Color(0xff41bdbb), + padding: EdgeInsets.only(right: 100, left: 100), + shape: RoundedRectangleBorder( + borderRadius: new BorderRadius.circular(18.0), + side: BorderSide(color: Color(0xff41bdbb)), + ), + child: Text( + 'Next Delivery', + style: TextStyle(color: Colors.white), + ), + onPressed: () {}, + ), + ], + ), + ), + ], + ), + ), + CustomerBrief( + itemId: item.driverID, + customerFirstName: item.firstName, + customerLastName: item.lastName, + mobileNo: item.mobileNumber + ), + ], + ), + ], + ), + ], + ), + ), + ), + ); + } +} + diff --git a/lib/pages/delivery/information_page.dart b/lib/pages/delivery/information_page.dart new file mode 100644 index 0000000..16e4852 --- /dev/null +++ b/lib/pages/delivery/information_page.dart @@ -0,0 +1,225 @@ +import 'package:driverapp/pages/delivery/delivery_confirmed_page.dart'; +import 'package:driverapp/widgets/delivery/customer_brief_card.dart'; +import 'package:driverapp/widgets/delivery/delivery_action_button.dart'; +import 'package:driverapp/widgets/delivery/package_content.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import '../../widgets/others/app_scaffold_widget.dart'; + +class InformationPage extends StatelessWidget { + final dynamic item; + + InformationPage(this.item); + + @override + Widget build(BuildContext context) { +// return AppScaffold( +// body: Center( +// child: InkWell(onTap: () {}, +// child: Texts('Replay Page')), +// ), +// ); + return AppScaffold( + body: Container( + color: Color(0xff41bdbb), + child: ListView( + children: [ + Column( + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + margin: EdgeInsets.only(right: 50), + child: IconButton( + color: Colors.white, + iconSize: 50, + icon: Icon(Icons.arrow_back), + onPressed: () { + Navigator.pop(context); + }, + ), + ), + Container( + child: Text( + 'Delivery information', + style: TextStyle( + color: Colors.white, + fontSize: 20, + ), + ), + ), + ], + ), + Stack( + children: [ + Container( + width: 400, + height: 500, + ), + Container( + width: 800, + height: 700, + margin: EdgeInsets.only(top: 100), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(45), + topRight: Radius.circular(45)), + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox( + height: 170, + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + delivery_info_button( + btnColor: Color(0xfff44336), + btnIcon: Icon( + Icons.near_me, + size: 30, + color: Colors.white, + ), + btnName: 'Location', + btnFunction: () {}, + ), + delivery_info_button( + btnColor: Colors.green, + btnIcon: Icon( + Icons.whatshot, + size: 30, + color: Colors.white, + ), + btnName: 'Whatsapp', + btnFunction: () {}, + ), + delivery_info_button( + btnColor: Colors.orangeAccent, + btnIcon: Icon( + Icons.mail_outline, + size: 30, + color: Colors.white, + ), + btnName: 'SMS', + btnFunction: () {}, + ), + delivery_info_button( + btnColor: Color(0xff41bdbb), + btnIcon: Icon( + Icons.phone, + size: 30, + color: Colors.white, + ), + btnName: 'Call', + btnFunction: () {}, + ), + ], + ), + SizedBox( + height: 30, + ), + Container( + margin: EdgeInsets.only(left: 15, right: 15), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Package Content', + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 20), + ), + SizedBox( + height: 20, + ), + package_content( + packageName: 'Panadol Extra 50 tablet', + packageCount: '5 box', + ), + SizedBox( + height: 10, + ), + package_content( + packageName: 'Xeractan 20MG 30 Capsules', + packageCount: '1 PCS', + ), + SizedBox( + height: 10, + ), + package_content( + packageName: 'Oltment for Rash unbranded 50 ml', + packageCount: '1 tube', + ), + SizedBox( + height: 10, + ), + package_content( + packageName: 'Face Mask 50 Pieces', + packageCount: '1 box', + ), + SizedBox( + height: 10, + ), + package_content( + packageName: 'Panadol Extra 50 tablet', + packageCount: '5 box', + ), + SizedBox( + height: 10, + ), + ], + ), + ), + SizedBox( + height: 30, + ), + FlatButton( + color: Color(0xff41bdbb), + padding: EdgeInsets.only( + right: 100, left: 100, bottom: 15, top: 15), + shape: RoundedRectangleBorder( + borderRadius: new BorderRadius.circular(30.0), + side: BorderSide(color: Color(0xff41bdbb)), + ), + child: Text( + 'Client Reached', + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 16), + ), + onPressed: () { + Navigator.push( + context, MaterialPageRoute( + builder: (context) => + DeliveryConfirmedPage(item))); + }, + ), + ], + ), + ), + CustomerBrief( + itemId: item.driverID, + customerFirstName: item.firstName, + customerLastName: item.lastName, + mobileNo: item.mobileNumber + ), + ], + ), + ], + ), + ], + ), + ), + ); + } +} + + + + + diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 6239d50..7d42558 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -1,10 +1,11 @@ -import 'package:driverapp/pages/landing/replay_page.dart'; +import 'package:driverapp/pages/delivery/delivery_confirmed_page.dart'; +import 'package:driverapp/pages/delivery/information_page.dart'; import 'package:driverapp/uitl/translations_delegate_base.dart'; import 'package:driverapp/widgets/bottom_navigation/bottom_nav_bar.dart'; import 'package:driverapp/widgets/drawer/app_drawer_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:driverapp/pages/dashboard/dashboard_screen.dart'; + import 'home_page.dart'; class LandingPage extends StatefulWidget { @@ -55,7 +56,12 @@ class _LandingPageState extends State { body: PageView( physics: NeverScrollableScrollPhysics(), controller: pageController, - children: [HomePage(), ReplayPage(), DashboardScreen(), Container()], + children: [ + HomePage(), + InformationPage(null), + DeliveryConfirmedPage(null), + Container() + ], ), bottomNavigationBar: BottomNavBar(changeIndex: _changeCurrentTab), ); diff --git a/lib/pages/landing/replay_page.dart b/lib/pages/landing/replay_page.dart index 712d83e..e3445e4 100644 --- a/lib/pages/landing/replay_page.dart +++ b/lib/pages/landing/replay_page.dart @@ -8,8 +8,10 @@ class ReplayPage extends StatelessWidget { Widget build(BuildContext context) { return AppScaffold( body: Center( - child: InkWell(onTap: () {}, child: Texts('Replay Page')), + child: InkWell(onTap: () {}, + child: Texts('Replay Page')), ), ); } } + diff --git a/lib/pages/orders/pending_orders_page.dart b/lib/pages/orders/pending_orders_page.dart index 624fb18..fd2dd0b 100644 --- a/lib/pages/orders/pending_orders_page.dart +++ b/lib/pages/orders/pending_orders_page.dart @@ -27,96 +27,112 @@ class _OrdersListScreenState extends State { ), body: Column( children: [ - Text( - 'Nearest', - style: TextStyle(color: Color(0xff30B7B9), fontSize: 18.0), + Center( + child: Text( + 'Nearest', + style: TextStyle( + color: Color(0xff30B7B9), + fontSize: 18.0, + fontWeight: FontWeight.w400), + ), ), - ListView.builder( - itemCount: model.orders == null ? 0 : model.orders.length, - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemBuilder: (BuildContext context, int index) { - return Padding( - padding: EdgeInsets.symmetric(horizontal: 12.2), - child: RoundedContainer( - height: MediaQuery.of(context).size.height * 0.11, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - flex: 1, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Padding( - padding: EdgeInsets.only(left: 22.0), - child: - Image.asset('assets/images/location.png'), - ) - ], - ), - ), - if (model.orders.length != 0) + Expanded( + child: ListView.builder( + itemCount: model.orders == null ? 0 : model.orders.length, + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemBuilder: (BuildContext context, int index) { + return Padding( + padding: EdgeInsets.symmetric(horizontal: 12.2), + child: RoundedContainer( + height: MediaQuery.of(context).orientation == + Orientation.portrait + ? MediaQuery.of(context).size.height * 0.107 + : MediaQuery.of(context).size.height * 0.18, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ Expanded( - flex: 3, + flex: 1, child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, children: [ - Text( - model.orders[index].firstName + - ' ' + - model.orders[index].lastName, - style: TextStyle(fontSize: 18.0), - ), - Text( - model.orders[index].mobileNumber, - style: TextStyle( - color: Color(0xff30B7B9), - fontWeight: FontWeight.w600, - fontSize: 15.0), - ), - Expanded( - child: Text( - 'Olaya ST, Behind kfc next to king ', - style: TextStyle(color: Colors.black45), + Padding( + padding: EdgeInsets.only(left: 22.0), + child: Image.asset( + 'assets/images/location.png', + height: + MediaQuery.of(context).size.height * + 0.101, ), - ) + ), ], ), ), - Padding( - padding: EdgeInsets.all(10.0), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: CircleAvatar( - backgroundColor: Colors.black45, - radius: 28.0, + if (model.orders.length != 0) + Expanded( + flex: 3, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Text( + model.orders[index].firstName + + ' ' + + model.orders[index].lastName, + style: TextStyle(fontSize: 18.0), + ), + ), + Text( + model.orders[index].mobileNumber, + style: TextStyle( + color: Color(0xff30B7B9), + fontWeight: FontWeight.w600, + fontSize: 15.0), + ), + Expanded( + child: Text( + 'Olaya ST, Behind kfc next to king ', + style: TextStyle(color: Colors.black45), + ), + ) + ], + ), + ), + Padding( + padding: EdgeInsets.all(10.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( child: CircleAvatar( - backgroundColor: Colors.white, - maxRadius: 25.1, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Text( - '3 K.m \n away', - style: TextStyle( - color: Color(0xff30B7B9), - fontSize: 12.5, - fontWeight: FontWeight.w600), + backgroundColor: Colors.black45, + radius: 28.0, + child: CircleAvatar( + backgroundColor: Colors.white, + maxRadius: 25.1, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + '3 K.m \n away', + style: TextStyle( + color: Color(0xff30B7B9), + fontSize: 12.5, + fontWeight: FontWeight.w600), + ), ), ), ), - ), - ) - ], + ) + ], + ), ), - ), - ], + ], + ), ), - ), - ); - }), + ); + }), + ), ], ), ), diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 400292e..b497c1a 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -49,9 +49,23 @@ class TranslationBase { String get english => localizedValues['english'][locale.languageCode]; String get arabic => localizedValues['arabic'][locale.languageCode]; - String get enterCredentialsMsg => localizedValues['enterCredentialsMsg'][locale.languageCode]; - String get forgotPassword => localizedValues['forgotPassword'][locale.languageCode]; + String get enterCredentialsMsg => + localizedValues['enterCredentialsMsg'][locale.languageCode]; + String get forgotPassword => + localizedValues['forgotPassword'][locale.languageCode]; String get login => localizedValues['login'][locale.languageCode]; + String get haveGreatDay => + localizedValues['haveGreatDay'][locale.languageCode]; + String get youHave => localizedValues['youHave'][locale.languageCode]; + String get deliveredPackages => + localizedValues['deliveredPackages'][locale.languageCode]; + String get seeAll => localizedValues['seeAll'][locale.languageCode]; + String get nearestDropOffs => + localizedValues['nearestDropOffs'][locale.languageCode]; + String get undeliveredPackages => + localizedValues['undeliveredPackages'][locale.languageCode]; + String get away => localizedValues['away'][locale.languageCode]; + String get scan => localizedValues['scan'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/delivery/customer_brief_card.dart b/lib/widgets/delivery/customer_brief_card.dart new file mode 100644 index 0000000..a7dbaf8 --- /dev/null +++ b/lib/widgets/delivery/customer_brief_card.dart @@ -0,0 +1,144 @@ +import 'package:flutter/material.dart'; + +class CustomerBrief extends StatelessWidget { + final int itemId; + final String time; + final String customerFirstName; + final String customerLastName; + final String mobileNo; + final String direction; + final String totalPayment; + final String deliveryTime; + + CustomerBrief( + {this.itemId, + this.time, + this.customerFirstName, + this.customerLastName, + this.mobileNo, + this.direction, + this.totalPayment, + this.deliveryTime}); + + @override + Widget build(BuildContext context) { + return Center( + child: Container( + width: 350, + height: 300, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(45), + topRight: Radius.circular(45), + bottomRight: Radius.circular(45), + bottomLeft: Radius.circular(45)), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.3), + spreadRadius: 5, + blurRadius: 7, + offset: Offset(0, 3), + ), + ], + ), + child: Container( + padding: EdgeInsets.only(left: 30, top: 10, right: 30), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Expanded( + child: Text('ID: ${itemId}'), + ), + Expanded( + child: Container( + margin: EdgeInsets.only(left: 83), + width: 10, + height: 60, + decoration: BoxDecoration( + border: Border.all( + width: 2.0, + color: Color(0xff41bdbb), + ), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(45), + topRight: Radius.circular(45), + bottomRight: Radius.circular(45), + bottomLeft: Radius.circular(45), + ), + ), + child: Container( + margin: EdgeInsets.only(left: 12, top: 10), + child: Text( + '3 min away', + style: TextStyle(color: Color(0xff41bdbb)), + ), + ), + ), + ), + ], + ), + Text( + '${customerFirstName} ${customerLastName}', + style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold), + ), + Text( + mobileNo, + style: TextStyle(color: Colors.lightBlue), + ), + SizedBox( + height: 10, + ), + Text( + 'Olaya street, behind KFC resturant, next to kingdom towers 2ND floor ofice 277', + style: TextStyle(fontWeight: FontWeight.w600), + ), + SizedBox( + height: 10, + ), + Divider( + color: Colors.grey, + ), + SizedBox( + height: 20, + ), + Column( + children: [ + Row( + children: [ + Text( + 'payment', + ), + SizedBox( + width: 170, + ), + Text( + 'SAR 70', + style: TextStyle(fontWeight: FontWeight.bold), + ), + ], + ), + SizedBox( + height: 20, + ), + Row( + children: [ + Text('Delivery Time'), + SizedBox( + width: 50, + ), + Text('05 Aug 20 - 10:00 AM', + style: TextStyle(fontWeight: FontWeight.bold)), + ], + ) + ], + ), + ], + ), + ), + ), + ); + } +} \ No newline at end of file diff --git a/lib/widgets/delivery/delivery_action_button.dart b/lib/widgets/delivery/delivery_action_button.dart new file mode 100644 index 0000000..4e05314 --- /dev/null +++ b/lib/widgets/delivery/delivery_action_button.dart @@ -0,0 +1,45 @@ +import 'package:flutter/material.dart'; + +class delivery_info_button extends StatelessWidget { + final Color btnColor; + final Icon btnIcon; + final Function btnFunction; + final String btnName; + + delivery_info_button( + {this.btnColor, this.btnIcon, this.btnFunction, this.btnName}); + @override + Widget build(BuildContext context) { + print(btnColor); + return Padding( + padding: EdgeInsets.all(8.0), + child: Column( + children: [ + SizedBox( + height: 50, + width: 60, // specific value + child: RaisedButton( + padding: EdgeInsets.only(left: 2), + color: btnColor, + shape: RoundedRectangleBorder( + borderRadius: new BorderRadius.circular(8.0), + ), + child: btnIcon, + onPressed: btnFunction, + ), + ), + SizedBox( + height: 10, + ), + Text( + btnName, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 10, + ), + ), + ], + ), + ); + } +} \ No newline at end of file diff --git a/lib/widgets/delivery/package_content.dart b/lib/widgets/delivery/package_content.dart new file mode 100644 index 0000000..0958b98 --- /dev/null +++ b/lib/widgets/delivery/package_content.dart @@ -0,0 +1,30 @@ +import 'package:flutter/material.dart'; + +class package_content extends StatelessWidget { + final String packageName; + final String packageCount; + + package_content({this.packageName, this.packageCount}); + + @override + Widget build(BuildContext context) { + return Row( + children: [ + Expanded( + flex: 2, + child: Text( + packageName, + style: TextStyle(color: Colors.grey, fontWeight: FontWeight.w400), + ), + ), + Expanded( + child: Text( + packageCount, + textAlign: TextAlign.end, + style: TextStyle(color: Colors.grey, fontWeight: FontWeight.w400), + ), + ), + ], + ); + } +} \ No newline at end of file