From 98929765263bfa2477361d501279e79169d85c08 Mon Sep 17 00:00:00 2001 From: enadhilal Date: Mon, 31 Aug 2020 11:11:41 +0300 Subject: [PATCH 1/5] improve design implementation in delivery_confirmed branch. --- lib/pages/delivery/information_page.dart | 124 ++++++++++-------- lib/widgets/delivery/customer_brief_card.dart | 120 ++++++++++------- .../delivery/delivery_action_button.dart | 4 +- 3 files changed, 140 insertions(+), 108 deletions(-) diff --git a/lib/pages/delivery/information_page.dart b/lib/pages/delivery/information_page.dart index d6c6502..f99dcff 100644 --- a/lib/pages/delivery/information_page.dart +++ b/lib/pages/delivery/information_page.dart @@ -1,4 +1,5 @@ import 'package:driverapp/pages/delivery/delivery_confirmed_page.dart'; +import 'package:driverapp/widgets/buttons/secondary_button.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'; @@ -17,9 +18,9 @@ class InformationPage extends StatelessWidget { Widget build(BuildContext context) { return AppScaffold( body: Container( - color: Color(0xff41bdbb), + color: Color(0xff3ABBBA), child: Container( - color: Color(0xff41bdbb), + color: Color(0xff3ABBBA), child: ListView( children: [ Column( @@ -32,7 +33,7 @@ class InformationPage extends StatelessWidget { right: MediaQuery .of(context) .size - .width * 0.15, //50 + .width * 0.10, //50 ), child: IconButton( color: Colors.white, @@ -83,10 +84,10 @@ class InformationPage extends StatelessWidget { top: MediaQuery .of(context) .size - .width * 0.3, //100 + .width * 0.23, //100 ), decoration: BoxDecoration( - color: Colors.white, + color: Theme.of(context).scaffoldBackgroundColor, borderRadius: BorderRadius.only( topLeft: Radius.circular(45), topRight: Radius.circular(45)), @@ -98,13 +99,13 @@ class InformationPage extends StatelessWidget { height: MediaQuery .of(context) .size - .width * 0.2, //170, + .width * 0.4, //170, ), Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - delivery_info_button( - btnColor: Color(0xfff44336), + deliveryInfoButton( + btnColor: Color(0xffED1C24), btnIcon: Icon( Icons.near_me, size: 30, @@ -115,8 +116,8 @@ class InformationPage extends StatelessWidget { .location, btnFunction: () {}, ), - delivery_info_button( - btnColor: Colors.green, + deliveryInfoButton( + btnColor: Color(0xFF61B260), btnIcon: Icon( Icons.whatshot, size: 30, @@ -125,8 +126,8 @@ class InformationPage extends StatelessWidget { btnName: 'Whatsapp', btnFunction: () {}, ), - delivery_info_button( - btnColor: Colors.orangeAccent, + deliveryInfoButton( + btnColor: Color(0xFFFCB657), btnIcon: Icon( Icons.mail_outline, size: 30, @@ -137,7 +138,7 @@ class InformationPage extends StatelessWidget { .sms, btnFunction: () {}, ), - delivery_info_button( + deliveryInfoButton( btnColor: Color(0xff41bdbb), btnIcon: Icon( Icons.phone, @@ -166,7 +167,7 @@ class InformationPage extends StatelessWidget { right: MediaQuery .of(context) .size - .width * 0.02, //15 + .width * 0.05, //15 ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -176,7 +177,7 @@ class InformationPage extends StatelessWidget { .of(context) .packageContent, style: TextStyle( - fontWeight: FontWeight.bold, + fontWeight: FontWeight.w900, fontSize: 20), ), SizedBox( @@ -194,7 +195,6 @@ class InformationPage extends StatelessWidget { .itemsQuantitiesList[index] .itemName .toString(), - //'Panadol Extra 50 tablet', packageCount: item .itemsQuantitiesList[index] .quantity @@ -217,47 +217,61 @@ class InformationPage extends StatelessWidget { .size .width * 0.1, //30, ), - FlatButton( - color: Color(0xff41bdbb), - padding: EdgeInsets.only( - right: MediaQuery - .of(context) - .size - .width * 0.3, //100, - left: MediaQuery - .of(context) - .size - .width * 0.3, //100, - bottom: MediaQuery - .of(context) - .size - .width * 0.035, //15, - top: MediaQuery - .of(context) - .size - .width * 0.035, //15 - ), - shape: RoundedRectangleBorder( - borderRadius: new BorderRadius.circular(30.0), - side: BorderSide(color: Color(0xff41bdbb)), - ), - child: Text( - TranslationBase - .of(context) - .clientReached, - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold, - fontSize: 16), + Container( + margin: EdgeInsets.all(10), +// height: MediaQuery.of(context).size.height *0.08, + child: SecondaryButton( + label: TranslationBase.of(context).clientReached, + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + DeliveryConfirmedPage(item))); + }, ), - onPressed: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - DeliveryConfirmedPage(item))); - }, ), +// FlatButton( +// color: Color(0xff41bdbb), +// padding: EdgeInsets.only( +// right: MediaQuery +// .of(context) +// .size +// .width * 0.3, //100, +// left: MediaQuery +// .of(context) +// .size +// .width * 0.3, //100, +// bottom: MediaQuery +// .of(context) +// .size +// .width * 0.035, //15, +// top: MediaQuery +// .of(context) +// .size +// .width * 0.035, //15 +// ), +// shape: RoundedRectangleBorder( +// borderRadius: new BorderRadius.circular(30.0), +// side: BorderSide(color: Color(0xff41bdbb)), +// ), +// child: Text( +// TranslationBase +// .of(context) +// .clientReached, +// style: TextStyle( +// color: Colors.white, +// fontWeight: FontWeight.bold, +// fontSize: 16), +// ), +// onPressed: () { +// Navigator.push( +// context, +// MaterialPageRoute( +// builder: (context) => +// DeliveryConfirmedPage(item))); +// }, +// ), ], ), ), diff --git a/lib/widgets/delivery/customer_brief_card.dart b/lib/widgets/delivery/customer_brief_card.dart index f0006ca..2836779 100644 --- a/lib/widgets/delivery/customer_brief_card.dart +++ b/lib/widgets/delivery/customer_brief_card.dart @@ -32,10 +32,10 @@ class CustomerBrief extends StatelessWidget { decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.only( - topLeft: Radius.circular(45), - topRight: Radius.circular(45), - bottomRight: Radius.circular(45), - bottomLeft: Radius.circular(45)), + topLeft: Radius.circular(30), + topRight: Radius.circular(30), + bottomRight: Radius.circular(30), + bottomLeft: Radius.circular(30)), boxShadow: [ BoxShadow( color: Colors.grey.withOpacity(0.3), @@ -53,30 +53,27 @@ class CustomerBrief extends StatelessWidget { Row( children: [ Expanded( - child: Text('ID: ${itemId}'), + flex: 3, + child: Text('ID: ${itemId}', style: TextStyle( + color: Color(0xFFADACAD) + ),), ), 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)), + 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), + ), ), ), ), @@ -85,24 +82,31 @@ class CustomerBrief extends StatelessWidget { ), Text( '${customerFirstName} ${customerLastName}', - style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold), + style: TextStyle(fontSize: 20, fontWeight: FontWeight.w900), ), Text( mobileNo, - style: TextStyle(color: Colors.lightBlue), + style: TextStyle(color: Color(0xFF50BDC5)), ), SizedBox( height: 10, ), Text( 'Olaya street, behind KFC resturant, next to kingdom towers 2ND floor ofice 277', - style: TextStyle(fontWeight: FontWeight.w600), + style: TextStyle(color: Color(0xFF464748),fontWeight: FontWeight.w600), ), SizedBox( height: 10, ), - Divider( - color: Colors.grey, + SizedBox( + height: 10.0, + child: Center( + child: Container( + margin: EdgeInsetsDirectional.only(start: 1.0, end: 1.0), + height: 1.0, + color: Colors.grey, + ), + ), ), SizedBox( height: 20, @@ -111,17 +115,24 @@ class CustomerBrief extends StatelessWidget { children: [ Row( children: [ - Text( - TranslationBase - .of(context) - .payment, + Expanded( + flex: 2, + child: Text( + TranslationBase + .of(context) + .payment, + textAlign: TextAlign.start, + ), ), SizedBox( width: 170, ), - Text( - totalPayment.toString(), //'SAR 70', - style: TextStyle(fontWeight: FontWeight.bold), + Expanded( + child: Text( + totalPayment.toString(), //'SAR 70', + textAlign: TextAlign.end, + style: TextStyle(fontWeight: FontWeight.w600), + ), ), ], ), @@ -130,21 +141,28 @@ class CustomerBrief extends StatelessWidget { ), Row( children: [ - Text( - TranslationBase - .of(context) - .delivryTime, + Expanded( + flex: 1, + child: Text( + TranslationBase + .of(context) + .delivryTime, + textAlign: TextAlign.start, + ), ), - SizedBox( - width: 50, +// SizedBox( +// width: 50, +// ), + Expanded( + child: Text( + '${DateUtil.getMonthDayYearDateFormatted( + DateUtil.convertStringToDate( + deliveryTime))} ${(DateUtil + .convertStringToHours(deliveryTime))}', + //'05 Aug 20 - 10:00 AM', + textAlign: TextAlign.end, + style: TextStyle(fontWeight: FontWeight.w600)), ), - Text( - '${DateUtil.getMonthDayYearDateFormatted( - DateUtil.convertStringToDate( - deliveryTime))} ${(DateUtil - .convertStringToHours(deliveryTime))}', - //'05 Aug 20 - 10:00 AM', - style: TextStyle(fontWeight: FontWeight.bold)), ], ) ], diff --git a/lib/widgets/delivery/delivery_action_button.dart b/lib/widgets/delivery/delivery_action_button.dart index 4e05314..adea467 100644 --- a/lib/widgets/delivery/delivery_action_button.dart +++ b/lib/widgets/delivery/delivery_action_button.dart @@ -1,12 +1,12 @@ import 'package:flutter/material.dart'; -class delivery_info_button extends StatelessWidget { +class deliveryInfoButton extends StatelessWidget { final Color btnColor; final Icon btnIcon; final Function btnFunction; final String btnName; - delivery_info_button( + deliveryInfoButton( {this.btnColor, this.btnIcon, this.btnFunction, this.btnName}); @override Widget build(BuildContext context) { From ed27e272442d1c7599ef39374655ebc05e9148db Mon Sep 17 00:00:00 2001 From: enadhilal Date: Tue, 1 Sep 2020 15:01:23 +0300 Subject: [PATCH 2/5] change base on comment in gitlab --- lib/pages/dashboard/dashboard_screen.dart | 2 +- ...d_page.dart => DeliveryConfirmedPage.dart} | 50 ++----------------- ...rmation_page.dart => InformationPage.dart} | 42 +++++++--------- lib/pages/landing/landing_page.dart | 4 +- lib/pages/orders/pending_orders_page.dart | 2 +- ...brief_card.dart => CustomerBriefCard.dart} | 29 ++++------- ..._button.dart => DeliveryActionButton.dart} | 15 ++++-- ...ckage_content.dart => PackageContent.dart} | 4 +- 8 files changed, 52 insertions(+), 96 deletions(-) rename lib/pages/delivery/{delivery_confirmed_page.dart => DeliveryConfirmedPage.dart} (74%) rename lib/pages/delivery/{information_page.dart => InformationPage.dart} (88%) rename lib/widgets/delivery/{customer_brief_card.dart => CustomerBriefCard.dart} (84%) rename lib/widgets/delivery/{delivery_action_button.dart => DeliveryActionButton.dart} (74%) rename lib/widgets/delivery/{package_content.dart => PackageContent.dart} (85%) diff --git a/lib/pages/dashboard/dashboard_screen.dart b/lib/pages/dashboard/dashboard_screen.dart index 3ca2e86..2e3a4c5 100644 --- a/lib/pages/dashboard/dashboard_screen.dart +++ b/lib/pages/dashboard/dashboard_screen.dart @@ -1,7 +1,7 @@ import 'package:barcode_scan/platform_wrapper.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/delivery/InformationPage.dart'; import 'package:driverapp/pages/orders/pending_orders_page.dart'; import 'package:driverapp/uitl/app_toast.dart'; import 'package:driverapp/uitl/utils.dart'; diff --git a/lib/pages/delivery/delivery_confirmed_page.dart b/lib/pages/delivery/DeliveryConfirmedPage.dart similarity index 74% rename from lib/pages/delivery/delivery_confirmed_page.dart rename to lib/pages/delivery/DeliveryConfirmedPage.dart index 1f5919c..9332477 100644 --- a/lib/pages/delivery/delivery_confirmed_page.dart +++ b/lib/pages/delivery/DeliveryConfirmedPage.dart @@ -1,5 +1,5 @@ import 'package:driverapp/widgets/buttons/secondary_button.dart'; -import 'package:driverapp/widgets/delivery/customer_brief_card.dart'; +import 'package:driverapp/widgets/delivery/CustomerBriefCard.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -16,7 +16,7 @@ class DeliveryConfirmedPage extends StatelessWidget { return AppScaffold( body: SafeArea( child: Container( - color: Color(0xff41bdbb), + color: Theme.of(context).disabledColor, child: ListView( children: [ Column( @@ -41,12 +41,10 @@ class DeliveryConfirmedPage extends StatelessWidget { children: [ Container( width: MediaQuery.of(context).size.width, - //300, height: MediaQuery.of(context).size.width * 0.7, - //300, padding: EdgeInsets.only( top: MediaQuery.of(context).size.width * - 0.2, //60, + 0.2, ), decoration: BoxDecoration( color: Colors.white10, @@ -84,8 +82,8 @@ class DeliveryConfirmedPage extends StatelessWidget { Stack( children: [ Container( - width: MediaQuery.of(context).size.width, //400, - height: MediaQuery.of(context).size.width, //500, + width: MediaQuery.of(context).size.width, + height: MediaQuery.of(context).size.width, ), Container( width: MediaQuery.of(context).size.width, @@ -110,16 +108,6 @@ class DeliveryConfirmedPage extends StatelessWidget { ), child: Column( children: [ -// Container( -// margin: EdgeInsets.all(10), -// child: SecondaryButton( -// color: Colors.orangeAccent, -// label: TranslationBase.of(context).addNoteBtn, -// icon: Icon(Icons.mode_edit), -// small: true, -// onTap: () {}, -// ), -// ), FlatButton.icon( padding: EdgeInsets.all(8), color: Colors.orangeAccent, @@ -143,39 +131,11 @@ class DeliveryConfirmedPage extends StatelessWidget { ), Container( margin: EdgeInsets.all(10), -// height: MediaQuery.of(context).size.height *0.08, child: SecondaryButton( label: TranslationBase.of(context) .nextDelivery, onTap: () {}, ), -// FlatButton( -// color: Color(0xff41bdbb), -// padding: -// EdgeInsets.only( -// right: MediaQuery -// .of(context) -// .size -// .width * 0.25, //100, -// left: MediaQuery -// .of(context) -// .size -// .width * 0.25, //100 -// ), -// shape: RoundedRectangleBorder( -// borderRadius: -// new BorderRadius.circular(18.0), -// side: -// BorderSide(color: Color(0xff41bdbb)), -// ), -// child: Text( -// TranslationBase -// .of(context) -// .nextDelivery, -// style: TextStyle(color: Colors.white), -// ), -// onPressed: () {}, -// ), ), ], ), diff --git a/lib/pages/delivery/information_page.dart b/lib/pages/delivery/InformationPage.dart similarity index 88% rename from lib/pages/delivery/information_page.dart rename to lib/pages/delivery/InformationPage.dart index 3d55ab0..db84f70 100644 --- a/lib/pages/delivery/information_page.dart +++ b/lib/pages/delivery/InformationPage.dart @@ -1,8 +1,8 @@ -import 'package:driverapp/pages/delivery/delivery_confirmed_page.dart'; +import 'package:driverapp/pages/delivery/DeliveryConfirmedPage.dart'; import 'package:driverapp/widgets/buttons/secondary_button.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:driverapp/widgets/delivery/CustomerBriefCard.dart'; +import 'package:driverapp/widgets/delivery/DeliveryActionButton.dart'; +import 'package:driverapp/widgets/delivery/PackageContent.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -18,14 +18,14 @@ class InformationPage extends StatelessWidget { Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, - appBarColor: Color(0xff3ABBBA), + appBarColor: Theme.of(context).disabledColor, arrowColor: Colors.white, titleColor: Colors.white, appBarTitle: TranslationBase.of(context).deliveryInfo, body: Container( - color: Color(0xff3ABBBA), + color: Theme.of(context).disabledColor, child: Container( - color: Color(0xff3ABBBA), + color: Theme.of(context).disabledColor, child: ListView( children: [ Column( @@ -36,28 +36,26 @@ class InformationPage extends StatelessWidget { width: MediaQuery .of(context) .size - .width, //400, + .width, height: MediaQuery .of(context) .size - .width, //500, + .width, ), Container( width: MediaQuery .of(context) .size .width * 1, - //800, height: MediaQuery .of(context) .size .width * 1.5, - //700, margin: EdgeInsets.only( top: MediaQuery .of(context) .size - .width * 0.23, //100 + .width * 0.23, ), decoration: BoxDecoration( color: Theme.of(context).scaffoldBackgroundColor, @@ -72,7 +70,7 @@ class InformationPage extends StatelessWidget { height: MediaQuery .of(context) .size - .width * 0.53, //170, + .width * 0.53, ), Row( mainAxisAlignment: MainAxisAlignment.center, @@ -112,7 +110,7 @@ class InformationPage extends StatelessWidget { btnFunction: () {}, ), deliveryInfoButton( - btnColor: Color(0xff41bdbb), + btnColor: Theme.of(context).disabledColor, btnIcon: Icon( Icons.phone, size: 30, @@ -129,18 +127,18 @@ class InformationPage extends StatelessWidget { height: MediaQuery .of(context) .size - .width * 0.1, //30, + .width * 0.1, ), Container( margin: EdgeInsets.only( left: MediaQuery .of(context) .size - .width * 0.05, //15, + .width * 0.05, right: MediaQuery .of(context) .size - .width * 0.05, //15 + .width * 0.05, ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -160,7 +158,7 @@ class InformationPage extends StatelessWidget { height: MediaQuery .of(context) .size - .width * 0.05, //20, + .width * 0.05, ), Padding( padding: const EdgeInsets.only(left: 10), @@ -168,12 +166,11 @@ class InformationPage extends StatelessWidget { children: List.generate( item.itemsQuantitiesList.length, (index) { - return package_content( + return packageContent( packageName: item .itemsQuantitiesList[index] .itemName .toString(), - //'Panadol Extra 50 tablet', packageCount: item .itemsQuantitiesList[index] .quantity @@ -186,7 +183,7 @@ class InformationPage extends StatelessWidget { height: MediaQuery .of(context) .size - .width * 0.01, //10, + .width * 0.01, ), ], ), @@ -195,11 +192,10 @@ class InformationPage extends StatelessWidget { height: MediaQuery .of(context) .size - .width * 0.1, //30, + .width * 0.1, ), Container( margin: EdgeInsets.all(10), -// height: MediaQuery.of(context).size.height *0.08, child: SecondaryButton( label: TranslationBase.of(context).clientReached, onTap: () { diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 7d42558..3d41564 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -1,5 +1,5 @@ -import 'package:driverapp/pages/delivery/delivery_confirmed_page.dart'; -import 'package:driverapp/pages/delivery/information_page.dart'; +import 'package:driverapp/pages/delivery/DeliveryConfirmedPage.dart'; +import 'package:driverapp/pages/delivery/InformationPage.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'; diff --git a/lib/pages/orders/pending_orders_page.dart b/lib/pages/orders/pending_orders_page.dart index b01d301..3b8d39d 100644 --- a/lib/pages/orders/pending_orders_page.dart +++ b/lib/pages/orders/pending_orders_page.dart @@ -1,5 +1,5 @@ import 'package:driverapp/core/viewModels/orders_view_model.dart'; -import 'package:driverapp/pages/delivery/information_page.dart'; +import 'package:driverapp/pages/delivery/InformationPage.dart'; import 'package:driverapp/widgets/others/app_scaffold_widget.dart'; import 'package:driverapp/widgets/others/rounded_container.dart'; import 'package:flutter/cupertino.dart'; diff --git a/lib/widgets/delivery/customer_brief_card.dart b/lib/widgets/delivery/CustomerBriefCard.dart similarity index 84% rename from lib/widgets/delivery/customer_brief_card.dart rename to lib/widgets/delivery/CustomerBriefCard.dart index 23c1530..a92c775 100644 --- a/lib/widgets/delivery/customer_brief_card.dart +++ b/lib/widgets/delivery/CustomerBriefCard.dart @@ -58,9 +58,10 @@ class CustomerBrief extends StatelessWidget { children: [ Expanded( flex: 3, - child: Text('ID: ${itemId}', style: TextStyle( - color: Color(0xFFADACAD) - ),), + child: Text( + 'ID: ${itemId}', + style: TextStyle(color: Color(0xFFADACAD)), + ), ), Expanded( child: CircleAvatar( @@ -97,7 +98,8 @@ class CustomerBrief extends StatelessWidget { ), Text( 'Olaya street, behind KFC resturant, next to kingdom towers 2nd floor ofice 277', - style: TextStyle(color: Color(0xFF464748),fontWeight: FontWeight.w600), + style: TextStyle( + color: Color(0xFF464748), fontWeight: FontWeight.w600), ), SizedBox( height: 10, @@ -122,9 +124,7 @@ class CustomerBrief extends StatelessWidget { Expanded( flex: 2, child: Text( - TranslationBase - .of(context) - .payment, + TranslationBase.of(context).payment, textAlign: TextAlign.start, ), ), @@ -133,7 +133,7 @@ class CustomerBrief extends StatelessWidget { ), Expanded( child: Text( - totalPayment.toString(), //'SAR 70', + totalPayment.toString(), textAlign: TextAlign.end, style: TextStyle(fontWeight: FontWeight.w600), ), @@ -148,22 +148,13 @@ class CustomerBrief extends StatelessWidget { Expanded( flex: 1, child: Text( - TranslationBase - .of(context) - .delivryTime, + TranslationBase.of(context).delivryTime, textAlign: TextAlign.start, ), ), -// SizedBox( -// width: 50, -// ), Expanded( child: Text( - '${DateUtil.getMonthDayYearDateFormatted( - DateUtil.convertStringToDate( - deliveryTime))} ${(DateUtil - .convertStringToHours(deliveryTime))}', - //'05 Aug 20 - 10:00 AM', + '${DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(deliveryTime))} ${(DateUtil.convertStringToHours(deliveryTime))}', textAlign: TextAlign.end, style: TextStyle(fontWeight: FontWeight.w600)), ), diff --git a/lib/widgets/delivery/delivery_action_button.dart b/lib/widgets/delivery/DeliveryActionButton.dart similarity index 74% rename from lib/widgets/delivery/delivery_action_button.dart rename to lib/widgets/delivery/DeliveryActionButton.dart index adea467..aaeeb32 100644 --- a/lib/widgets/delivery/delivery_action_button.dart +++ b/lib/widgets/delivery/DeliveryActionButton.dart @@ -16,8 +16,14 @@ class deliveryInfoButton extends StatelessWidget { child: Column( children: [ SizedBox( - height: 50, - width: 60, // specific value + height: MediaQuery + .of(context) + .size + .width * 0.14, + width: MediaQuery + .of(context) + .size + .width * 0.165, // specific value child: RaisedButton( padding: EdgeInsets.only(left: 2), color: btnColor, @@ -29,7 +35,10 @@ class deliveryInfoButton extends StatelessWidget { ), ), SizedBox( - height: 10, + height: MediaQuery + .of(context) + .size + .width * 0.05, ), Text( btnName, diff --git a/lib/widgets/delivery/package_content.dart b/lib/widgets/delivery/PackageContent.dart similarity index 85% rename from lib/widgets/delivery/package_content.dart rename to lib/widgets/delivery/PackageContent.dart index 0958b98..46f93aa 100644 --- a/lib/widgets/delivery/package_content.dart +++ b/lib/widgets/delivery/PackageContent.dart @@ -1,10 +1,10 @@ import 'package:flutter/material.dart'; -class package_content extends StatelessWidget { +class packageContent extends StatelessWidget { final String packageName; final String packageCount; - package_content({this.packageName, this.packageCount}); + packageContent({this.packageName, this.packageCount}); @override Widget build(BuildContext context) { From 9d9f411bd01a9519dca79a969b99a5d707d0b24e Mon Sep 17 00:00:00 2001 From: enadhilal Date: Tue, 1 Sep 2020 16:15:02 +0300 Subject: [PATCH 3/5] change base on comment in gitlab --- lib/pages/delivery/DeliveryConfirmedPage.dart | 2 +- lib/pages/delivery/InformationPage.dart | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/pages/delivery/DeliveryConfirmedPage.dart b/lib/pages/delivery/DeliveryConfirmedPage.dart index 9332477..018bcf9 100644 --- a/lib/pages/delivery/DeliveryConfirmedPage.dart +++ b/lib/pages/delivery/DeliveryConfirmedPage.dart @@ -16,7 +16,7 @@ class DeliveryConfirmedPage extends StatelessWidget { return AppScaffold( body: SafeArea( child: Container( - color: Theme.of(context).disabledColor, + color: Theme.of(context).primaryColor, child: ListView( children: [ Column( diff --git a/lib/pages/delivery/InformationPage.dart b/lib/pages/delivery/InformationPage.dart index db84f70..7fd5567 100644 --- a/lib/pages/delivery/InformationPage.dart +++ b/lib/pages/delivery/InformationPage.dart @@ -18,14 +18,14 @@ class InformationPage extends StatelessWidget { Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, - appBarColor: Theme.of(context).disabledColor, + appBarColor: Theme.of(context).primaryColor, arrowColor: Colors.white, titleColor: Colors.white, appBarTitle: TranslationBase.of(context).deliveryInfo, body: Container( - color: Theme.of(context).disabledColor, + color: Theme.of(context).primaryColor, child: Container( - color: Theme.of(context).disabledColor, + color: Theme.of(context).primaryColor, child: ListView( children: [ Column( @@ -110,7 +110,7 @@ class InformationPage extends StatelessWidget { btnFunction: () {}, ), deliveryInfoButton( - btnColor: Theme.of(context).disabledColor, + btnColor: Theme.of(context).primaryColor, btnIcon: Icon( Icons.phone, size: 30, From 778fd5374deb77bab87c5b6e3f57303145d46b83 Mon Sep 17 00:00:00 2001 From: enadhilal Date: Tue, 1 Sep 2020 16:22:01 +0300 Subject: [PATCH 4/5] change class and file name --- lib/pages/dashboard/dashboard_screen.dart | 2 +- ...ConfirmedPage.dart => delivery_confirmed_page.dart} | 4 ++-- .../{InformationPage.dart => information_page.dart} | 10 +++++----- lib/pages/landing/landing_page.dart | 4 ++-- lib/pages/orders/pending_orders_page.dart | 2 +- ...CustomerBriefCard.dart => customer_brief_card.dart} | 4 ++-- ...ryActionButton.dart => delivery_action_button.dart} | 0 .../{PackageContent.dart => package_content.dart} | 0 8 files changed, 13 insertions(+), 13 deletions(-) rename lib/pages/delivery/{DeliveryConfirmedPage.dart => delivery_confirmed_page.dart} (98%) rename lib/pages/delivery/{InformationPage.dart => information_page.dart} (96%) rename lib/widgets/delivery/{CustomerBriefCard.dart => customer_brief_card.dart} (98%) rename lib/widgets/delivery/{DeliveryActionButton.dart => delivery_action_button.dart} (100%) rename lib/widgets/delivery/{PackageContent.dart => package_content.dart} (100%) diff --git a/lib/pages/dashboard/dashboard_screen.dart b/lib/pages/dashboard/dashboard_screen.dart index 2e3a4c5..3ca2e86 100644 --- a/lib/pages/dashboard/dashboard_screen.dart +++ b/lib/pages/dashboard/dashboard_screen.dart @@ -1,7 +1,7 @@ import 'package:barcode_scan/platform_wrapper.dart'; import 'package:driverapp/core/enum/viewstate.dart'; import 'package:driverapp/core/viewModels/orders_view_model.dart'; -import 'package:driverapp/pages/delivery/InformationPage.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'; diff --git a/lib/pages/delivery/DeliveryConfirmedPage.dart b/lib/pages/delivery/delivery_confirmed_page.dart similarity index 98% rename from lib/pages/delivery/DeliveryConfirmedPage.dart rename to lib/pages/delivery/delivery_confirmed_page.dart index 018bcf9..e56656c 100644 --- a/lib/pages/delivery/DeliveryConfirmedPage.dart +++ b/lib/pages/delivery/delivery_confirmed_page.dart @@ -1,5 +1,5 @@ import 'package:driverapp/widgets/buttons/secondary_button.dart'; -import 'package:driverapp/widgets/delivery/CustomerBriefCard.dart'; +import 'package:driverapp/widgets/delivery/customer_brief_card.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -143,7 +143,7 @@ class DeliveryConfirmedPage extends StatelessWidget { ], ), ), - CustomerBrief( + CustomerBriefCard( itemId: item.patientID, customerFirstName: item.firstName, customerLastName: item.lastName, diff --git a/lib/pages/delivery/InformationPage.dart b/lib/pages/delivery/information_page.dart similarity index 96% rename from lib/pages/delivery/InformationPage.dart rename to lib/pages/delivery/information_page.dart index 7fd5567..f4ed23c 100644 --- a/lib/pages/delivery/InformationPage.dart +++ b/lib/pages/delivery/information_page.dart @@ -1,8 +1,8 @@ -import 'package:driverapp/pages/delivery/DeliveryConfirmedPage.dart'; +import 'package:driverapp/pages/delivery/delivery_confirmed_page.dart'; import 'package:driverapp/widgets/buttons/secondary_button.dart'; -import 'package:driverapp/widgets/delivery/CustomerBriefCard.dart'; -import 'package:driverapp/widgets/delivery/DeliveryActionButton.dart'; -import 'package:driverapp/widgets/delivery/PackageContent.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'; @@ -210,7 +210,7 @@ class InformationPage extends StatelessWidget { ], ), ), - CustomerBrief( + CustomerBriefCard( itemId: item.patientID, customerFirstName: item.firstName, customerLastName: item.lastName, diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 3d41564..7d42558 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -1,5 +1,5 @@ -import 'package:driverapp/pages/delivery/DeliveryConfirmedPage.dart'; -import 'package:driverapp/pages/delivery/InformationPage.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'; diff --git a/lib/pages/orders/pending_orders_page.dart b/lib/pages/orders/pending_orders_page.dart index 3b8d39d..b01d301 100644 --- a/lib/pages/orders/pending_orders_page.dart +++ b/lib/pages/orders/pending_orders_page.dart @@ -1,5 +1,5 @@ import 'package:driverapp/core/viewModels/orders_view_model.dart'; -import 'package:driverapp/pages/delivery/InformationPage.dart'; +import 'package:driverapp/pages/delivery/information_page.dart'; import 'package:driverapp/widgets/others/app_scaffold_widget.dart'; import 'package:driverapp/widgets/others/rounded_container.dart'; import 'package:flutter/cupertino.dart'; diff --git a/lib/widgets/delivery/CustomerBriefCard.dart b/lib/widgets/delivery/customer_brief_card.dart similarity index 98% rename from lib/widgets/delivery/CustomerBriefCard.dart rename to lib/widgets/delivery/customer_brief_card.dart index a92c775..05bb430 100644 --- a/lib/widgets/delivery/CustomerBriefCard.dart +++ b/lib/widgets/delivery/customer_brief_card.dart @@ -3,7 +3,7 @@ import 'package:flutter/material.dart'; import '../../uitl/date_uitl.dart'; import '../../uitl/translations_delegate_base.dart'; -class CustomerBrief extends StatelessWidget { +class CustomerBriefCard extends StatelessWidget { final String itemId; final String time; final String customerFirstName; @@ -15,7 +15,7 @@ class CustomerBrief extends StatelessWidget { final double longitude; final double latitude; - CustomerBrief( + CustomerBriefCard( {this.itemId, this.time, this.customerFirstName, diff --git a/lib/widgets/delivery/DeliveryActionButton.dart b/lib/widgets/delivery/delivery_action_button.dart similarity index 100% rename from lib/widgets/delivery/DeliveryActionButton.dart rename to lib/widgets/delivery/delivery_action_button.dart diff --git a/lib/widgets/delivery/PackageContent.dart b/lib/widgets/delivery/package_content.dart similarity index 100% rename from lib/widgets/delivery/PackageContent.dart rename to lib/widgets/delivery/package_content.dart From 6876e1da7770e6509db736eddfab73756457c8da Mon Sep 17 00:00:00 2001 From: enadhilal Date: Tue, 1 Sep 2020 16:25:04 +0300 Subject: [PATCH 5/5] change class and file name --- lib/pages/delivery/information_page.dart | 8 ++++---- lib/widgets/delivery/delivery_action_button.dart | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/pages/delivery/information_page.dart b/lib/pages/delivery/information_page.dart index f4ed23c..ec8ba72 100644 --- a/lib/pages/delivery/information_page.dart +++ b/lib/pages/delivery/information_page.dart @@ -75,7 +75,7 @@ class InformationPage extends StatelessWidget { Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - deliveryInfoButton( + DeliveryInfoButton( btnColor: Color(0xffED1C24), btnIcon: Icon( Icons.near_me, @@ -87,7 +87,7 @@ class InformationPage extends StatelessWidget { .location, btnFunction: () {}, ), - deliveryInfoButton( + DeliveryInfoButton( btnColor: Color(0xFF61B260), btnIcon: Icon( Icons.whatshot, @@ -97,7 +97,7 @@ class InformationPage extends StatelessWidget { btnName: 'Whatsapp', btnFunction: () {}, ), - deliveryInfoButton( + DeliveryInfoButton( btnColor: Color(0xFFFCB657), btnIcon: Icon( Icons.mail_outline, @@ -109,7 +109,7 @@ class InformationPage extends StatelessWidget { .sms, btnFunction: () {}, ), - deliveryInfoButton( + DeliveryInfoButton( btnColor: Theme.of(context).primaryColor, btnIcon: Icon( Icons.phone, diff --git a/lib/widgets/delivery/delivery_action_button.dart b/lib/widgets/delivery/delivery_action_button.dart index aaeeb32..3571218 100644 --- a/lib/widgets/delivery/delivery_action_button.dart +++ b/lib/widgets/delivery/delivery_action_button.dart @@ -1,12 +1,12 @@ import 'package:flutter/material.dart'; -class deliveryInfoButton extends StatelessWidget { +class DeliveryInfoButton extends StatelessWidget { final Color btnColor; final Icon btnIcon; final Function btnFunction; final String btnName; - deliveryInfoButton( + DeliveryInfoButton( {this.btnColor, this.btnIcon, this.btnFunction, this.btnName}); @override Widget build(BuildContext context) {