From 89fe5dfbdcf9a7210993187a64dade570447b8a0 Mon Sep 17 00:00:00 2001 From: enadhilal Date: Mon, 24 Aug 2020 12:37:03 +0300 Subject: [PATCH 1/7] add delivery pages and widget --- .../delivery/delivery_confirmed_page.dart | 145 ++++++++++++ lib/pages/delivery/information_page.dart | 209 ++++++++++++++++++ lib/pages/landing/landing_page.dart | 4 +- lib/pages/landing/replay_page.dart | 4 +- lib/widgets/delivery/customer_brief_card.dart | 142 ++++++++++++ .../delivery/delivery_action_button.dart | 45 ++++ lib/widgets/delivery/package_content.dart | 30 +++ 7 files changed, 577 insertions(+), 2 deletions(-) create mode 100644 lib/pages/delivery/delivery_confirmed_page.dart create mode 100644 lib/pages/delivery/information_page.dart create mode 100644 lib/widgets/delivery/customer_brief_card.dart create mode 100644 lib/widgets/delivery/delivery_action_button.dart create mode 100644 lib/widgets/delivery/package_content.dart diff --git a/lib/pages/delivery/delivery_confirmed_page.dart b/lib/pages/delivery/delivery_confirmed_page.dart new file mode 100644 index 0000000..2c8ca26 --- /dev/null +++ b/lib/pages/delivery/delivery_confirmed_page.dart @@ -0,0 +1,145 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:driverapp/widgets/delivery/customer_brief_card.dart'; + +class DeliveryConfirmedPage extends StatelessWidget { + + @override + Widget build(BuildContext context) { + return Scaffold( + 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(), + ], + ), + ], + ), + ], + ), + ), + ), + ); + } +} + diff --git a/lib/pages/delivery/information_page.dart b/lib/pages/delivery/information_page.dart new file mode 100644 index 0000000..bf12d6b --- /dev/null +++ b/lib/pages/delivery/information_page.dart @@ -0,0 +1,209 @@ +import 'package:driverapp/widgets/data_display/text.dart'; +import 'package:driverapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +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'; + +class InformationPage extends StatelessWidget { + @override + Widget build(BuildContext context) { +// return AppScaffold( +// body: Center( +// child: InkWell(onTap: () {}, +// child: Texts('Replay Page')), +// ), +// ); + return 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: () {}, + ), + ), + 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())); + }, + ), + ], + ), + ), + CustomerBrief(), + ], + ), + ], + ), + ], + ), + ); + } +} + + + + + diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index a14e9eb..303ff8f 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -4,6 +4,8 @@ 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/delivery/information_page.dart'; +import 'package:driverapp/pages/delivery/delivery_confirmed_page.dart'; import 'home_page.dart'; @@ -55,7 +57,7 @@ class _LandingPageState extends State { body: PageView( physics: NeverScrollableScrollPhysics(), controller: pageController, - children: [HomePage(), ReplayPage(), Container(), Container()], + children: [HomePage(), InformationPage(), DeliveryConfirmedPage(), 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/widgets/delivery/customer_brief_card.dart b/lib/widgets/delivery/customer_brief_card.dart new file mode 100644 index 0000000..0b843d2 --- /dev/null +++ b/lib/widgets/delivery/customer_brief_card.dart @@ -0,0 +1,142 @@ +import 'package:flutter/material.dart'; + +class CustomerBrief extends StatelessWidget { + final String itemId; + final String time; + final String customerName; + final String mobileNo; + final String direction; + final String totalPayment; + final String deliveryTime; + + CustomerBrief( + {this.itemId, + this.time, + this.customerName, + 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: 123456789'), + ), + 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( + 'Abdullah Olyan', + style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold), + ), + Text( + '05XXXXXXXX', + 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 From 5b35d5d09a3a1364976f288bac12e24beb96cee6 Mon Sep 17 00:00:00 2001 From: enadhilal Date: Tue, 25 Aug 2020 14:23:53 +0300 Subject: [PATCH 2/7] add route from dashboard and delivery info with item data --- lib/core/model/pending_orders/pending_orders_model.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/core/model/pending_orders/pending_orders_model.dart b/lib/core/model/pending_orders/pending_orders_model.dart index c2ef9e3..0243dc8 100644 --- a/lib/core/model/pending_orders/pending_orders_model.dart +++ b/lib/core/model/pending_orders/pending_orders_model.dart @@ -1,4 +1,4 @@ -import 'dart:ffi'; + class PendingOrders { int driverID; From fac623020539a9f87ee4ef43b8858e5f06a96d90 Mon Sep 17 00:00:00 2001 From: enadhilal Date: Tue, 25 Aug 2020 14:39:55 +0300 Subject: [PATCH 3/7] add route from dashboard and delivery info with item data step 2 --- lib/pages/dashboard/dashboard_screen.dart | 135 ++++--- lib/pages/delivery/information_page.dart | 364 +++++++++--------- lib/pages/landing/landing_page.dart | 12 +- lib/widgets/delivery/customer_brief_card.dart | 14 +- 4 files changed, 277 insertions(+), 248 deletions(-) diff --git a/lib/pages/dashboard/dashboard_screen.dart b/lib/pages/dashboard/dashboard_screen.dart index 94ff6ae..7d9eb6e 100644 --- a/lib/pages/dashboard/dashboard_screen.dart +++ b/lib/pages/dashboard/dashboard_screen.dart @@ -1,11 +1,12 @@ import 'package:driverapp/config/size_config.dart'; import 'package:driverapp/core/viewModels/pending_orders_view_model.dart'; +import 'package:driverapp/pages/delivery/information_page.dart'; +import 'package:driverapp/pages/orders/pending_orders_page.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 @@ -315,72 +316,80 @@ class _DashboardScreenState extends State { itemCount: //model.orders == null ? 0 : model.orders.length, 2, itemBuilder: (BuildContext context, int index) { - return Padding( - padding: EdgeInsets.symmetric(horizontal: 12.0), - child: RoundedContainer( - height: SizeConfig.heightMultiplier * 10.5, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Padding( - padding: EdgeInsets.only(left: 22.0), - child: Image.asset( - 'assets/images/location.png'), - ) - ], - ), - if (model.orders.length != 0) + return GestureDetector( + onTap: () { + Navigator.push( + context, MaterialPageRoute(builder: (context) => + InformationPage(model.orders[index]))); + }, + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 12.0), + child: RoundedContainer( + height: SizeConfig.heightMultiplier * 10.5, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ Column( - crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, children: [ - Text( - model.orders[index].firstName + - ' ' + - model.orders[index].lastName, - style: TextStyle(fontSize: 20.0), - ), - Text( - model.orders[index].mobileNumber, - style: TextStyle( - color: Color(0xff30B7B9), - fontWeight: FontWeight.w600, - fontSize: 15.0), - ), - Text( - 'Olaya ST, Behind kfc next to king-\ndom tower 2nd floor n.o 247', - style: TextStyle(color: Colors.black45), + Padding( + padding: EdgeInsets.only(left: 22.0), + child: Image.asset( + 'assets/images/location.png'), ) ], ), - Padding( - padding: EdgeInsets.all(10.0), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - CircleAvatar( - backgroundColor: Colors.black45, - radius: 30.0, - child: CircleAvatar( - backgroundColor: Colors.white, - maxRadius: 28.9, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Text( - '3 K.m \n away', - style: TextStyle( - color: Color(0xff30B7B9), - fontSize: 14.0), + if (model.orders.length != 0) + Column( + crossAxisAlignment: CrossAxisAlignment + .start, + children: [ + Text( + model.orders[index].firstName + + ' ' + + model.orders[index].lastName, + style: TextStyle(fontSize: 20.0), + ), + Text( + model.orders[index].mobileNumber, + style: TextStyle( + color: Color(0xff30B7B9), + fontWeight: FontWeight.w600, + fontSize: 15.0), + ), + Text( + 'Olaya ST, Behind kfc next to king-\ndom tower 2nd floor n.o 247', + style: TextStyle(color: Colors.black45), + ) + ], + ), + Padding( + padding: EdgeInsets.all(10.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + CircleAvatar( + backgroundColor: Colors.black45, + radius: 30.0, + child: CircleAvatar( + backgroundColor: Colors.white, + maxRadius: 28.9, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + '3 K.m \n away', + style: TextStyle( + color: Color(0xff30B7B9), + fontSize: 14.0), + ), ), ), - ), - ) - ], - ), - ) - ], + ) + ], + ), + ) + ], + ), ), ), ); diff --git a/lib/pages/delivery/information_page.dart b/lib/pages/delivery/information_page.dart index bf12d6b..38e1844 100644 --- a/lib/pages/delivery/information_page.dart +++ b/lib/pages/delivery/information_page.dart @@ -1,13 +1,15 @@ -import 'package:driverapp/widgets/data_display/text.dart'; -import 'package:driverapp/widgets/others/app_scaffold_widget.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; 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'; class InformationPage extends StatelessWidget { + final dynamic item; + + InformationPage(this.item); + @override Widget build(BuildContext context) { // return AppScaffold( @@ -16,188 +18,200 @@ class InformationPage extends StatelessWidget { // child: Texts('Replay Page')), // ), // ); - return 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: () {}, - ), - ), - Container( - child: Text( - 'Delivery information', - style: TextStyle( + return Scaffold( + 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, - fontSize: 20, + iconSize: 50, + icon: Icon(Icons.arrow_back), + onPressed: () { + Navigator.pop(context); + }, ), ), - ), - ], - ), - 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, + Container( + child: Text( + 'Delivery information', + style: TextStyle( + color: Colors.white, + fontSize: 20, ), - 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, + ), + ), + ], + ), + 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: [ - 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, + 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, - ), - 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)), + SizedBox( + height: 30, ), - child: Text( - 'Client Reached', - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold, - fontSize: 16), + 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, + ), + ], + ), ), - onPressed: () { - Navigator.push( - context, MaterialPageRoute(builder: (context) => DeliveryConfirmedPage())); - }, - ), - ], + 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())); + }, + ), + ], + ), + ), + CustomerBrief( + itemId: item.driverID, + customerFirstName: item.firstName, + customerLastName: item.lastName, + mobileNo: item.mobileNumber ), - ), - CustomerBrief(), - ], - ), - ], - ), - ], + ], + ), + ], + ), + ], + ), ), ); } diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 303ff8f..be3803e 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -1,11 +1,10 @@ -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/delivery/information_page.dart'; -import 'package:driverapp/pages/delivery/delivery_confirmed_page.dart'; import 'home_page.dart'; @@ -57,7 +56,12 @@ class _LandingPageState extends State { body: PageView( physics: NeverScrollableScrollPhysics(), controller: pageController, - children: [HomePage(), InformationPage(), DeliveryConfirmedPage(), Container()], + children: [ + HomePage(), + InformationPage(null), + DeliveryConfirmedPage(), + Container() + ], ), bottomNavigationBar: BottomNavBar(changeIndex: _changeCurrentTab), ); diff --git a/lib/widgets/delivery/customer_brief_card.dart b/lib/widgets/delivery/customer_brief_card.dart index 0b843d2..a7dbaf8 100644 --- a/lib/widgets/delivery/customer_brief_card.dart +++ b/lib/widgets/delivery/customer_brief_card.dart @@ -1,9 +1,10 @@ import 'package:flutter/material.dart'; class CustomerBrief extends StatelessWidget { - final String itemId; + final int itemId; final String time; - final String customerName; + final String customerFirstName; + final String customerLastName; final String mobileNo; final String direction; final String totalPayment; @@ -12,7 +13,8 @@ class CustomerBrief extends StatelessWidget { CustomerBrief( {this.itemId, this.time, - this.customerName, + this.customerFirstName, + this.customerLastName, this.mobileNo, this.direction, this.totalPayment, @@ -48,7 +50,7 @@ class CustomerBrief extends StatelessWidget { Row( children: [ Expanded( - child: Text('ID: 123456789'), + child: Text('ID: ${itemId}'), ), Expanded( child: Container( @@ -79,11 +81,11 @@ class CustomerBrief extends StatelessWidget { ], ), Text( - 'Abdullah Olyan', + '${customerFirstName} ${customerLastName}', style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold), ), Text( - '05XXXXXXXX', + mobileNo, style: TextStyle(color: Colors.lightBlue), ), SizedBox( From de394ec807aca46a96ddcb0455491e53ab3d60fa Mon Sep 17 00:00:00 2001 From: enadhilal Date: Wed, 26 Aug 2020 08:19:03 +0300 Subject: [PATCH 4/7] add changes based on the comment. --- .../pending_orders/pending_orders_model.dart | 2 -- lib/pages/dashboard/dashboard_screen.dart | 2 +- .../delivery/delivery_confirmed_page.dart | 18 ++++++++++++++---- lib/pages/delivery/information_page.dart | 6 ++++-- lib/pages/landing/landing_page.dart | 2 +- 5 files changed, 20 insertions(+), 10 deletions(-) diff --git a/lib/core/model/pending_orders/pending_orders_model.dart b/lib/core/model/pending_orders/pending_orders_model.dart index 0243dc8..875636b 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 @@ - - class PendingOrders { int driverID; String searchKey; diff --git a/lib/pages/dashboard/dashboard_screen.dart b/lib/pages/dashboard/dashboard_screen.dart index 7d9eb6e..a0e56ed 100644 --- a/lib/pages/dashboard/dashboard_screen.dart +++ b/lib/pages/dashboard/dashboard_screen.dart @@ -316,7 +316,7 @@ class _DashboardScreenState extends State { itemCount: //model.orders == null ? 0 : model.orders.length, 2, itemBuilder: (BuildContext context, int index) { - return GestureDetector( + return InkWell( onTap: () { Navigator.push( context, MaterialPageRoute(builder: (context) => diff --git a/lib/pages/delivery/delivery_confirmed_page.dart b/lib/pages/delivery/delivery_confirmed_page.dart index 2c8ca26..e7af05a 100644 --- a/lib/pages/delivery/delivery_confirmed_page.dart +++ b/lib/pages/delivery/delivery_confirmed_page.dart @@ -1,12 +1,17 @@ +import 'package:driverapp/widgets/delivery/customer_brief_card.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:driverapp/widgets/delivery/customer_brief_card.dart'; + +import '../../widgets/others/app_scaffold_widget.dart'; class DeliveryConfirmedPage extends StatelessWidget { + final dynamic item; + + DeliveryConfirmedPage(this.item); @override Widget build(BuildContext context) { - return Scaffold( + return AppScaffold( body: SafeArea( child: Container( color: Color(0xff41bdbb), @@ -18,7 +23,7 @@ class DeliveryConfirmedPage extends StatelessWidget { children: [ Container( child: Container( - alignment: Alignment.topLeft, + alignment: Alignment.topLeft, child: IconButton( color: Colors.white, iconSize: 40, @@ -130,7 +135,12 @@ class DeliveryConfirmedPage extends StatelessWidget { ], ), ), - CustomerBrief(), + 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 index 38e1844..16e4852 100644 --- a/lib/pages/delivery/information_page.dart +++ b/lib/pages/delivery/information_page.dart @@ -5,6 +5,8 @@ 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; @@ -18,7 +20,7 @@ class InformationPage extends StatelessWidget { // child: Texts('Replay Page')), // ), // ); - return Scaffold( + return AppScaffold( body: Container( color: Color(0xff41bdbb), child: ListView( @@ -194,7 +196,7 @@ class InformationPage extends StatelessWidget { Navigator.push( context, MaterialPageRoute( builder: (context) => - DeliveryConfirmedPage())); + DeliveryConfirmedPage(item))); }, ), ], diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index be3803e..7d42558 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -59,7 +59,7 @@ class _LandingPageState extends State { children: [ HomePage(), InformationPage(null), - DeliveryConfirmedPage(), + DeliveryConfirmedPage(null), Container() ], ), From dcedc989e18641426a093b5c8fd70ad459b99ef2 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 26 Aug 2020 08:19:53 +0300 Subject: [PATCH 5/7] updates --- lib/config/localized_values.dart | 24 ++- .../pending_orders/pending_orders_model.dart | 26 +-- lib/pages/dashboard/dashboard_screen.dart | 177 ++++++++++-------- lib/pages/orders/pending_orders_page.dart | 168 +++++++++-------- lib/uitl/translations_delegate_base.dart | 18 +- 5 files changed, 234 insertions(+), 179 deletions(-) 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..b6dfc6e 100644 --- a/lib/core/model/pending_orders/pending_orders_model.dart +++ b/lib/core/model/pending_orders/pending_orders_model.dart @@ -11,18 +11,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 +38,7 @@ class PendingOrders { firstName = json['FirstName']; lastName = json['LastName']; mobileNumber = json['MobileNumber']; + distanceInKilometers = json['DistanceInKilometers']; } Map toJson() { diff --git a/lib/pages/dashboard/dashboard_screen.dart b/lib/pages/dashboard/dashboard_screen.dart index b9a81c4..5a00639 100644 --- a/lib/pages/dashboard/dashboard_screen.dart +++ b/lib/pages/dashboard/dashboard_screen.dart @@ -6,6 +6,7 @@ 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'; +import 'package:driverapp/widgets/others/app_scaffold_widget.dart'; class DashboardScreen extends StatefulWidget { @override @@ -15,12 +16,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, PendingOrdersViewModel model, Widget child) => - Scaffold( - backgroundColor: Color(0xffF4F9FA), + AppScaffold( body: Column( // mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, @@ -210,7 +211,6 @@ class _DashboardScreenState extends State { 0.10, width: MediaQuery.of(context).size.width * 0.20, - scale: 0.9, fit: BoxFit.cover, ), ], @@ -328,98 +328,113 @@ 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, - children: [ - Expanded( - child: CircleAvatar( - backgroundColor: Colors.black45, - radius: 28.0, + 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.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), + ), ), ), ), - ), - ) - ], + ) + ], + ), ), - ), - ], + ], + ), ), - ), - ); - }) - ], + onTap: () => Navigator.push( + context, + MaterialPageRoute( + builder: (context) => OrdersListScreen()), + )), + ); + }), ) ], ), diff --git a/lib/pages/orders/pending_orders_page.dart b/lib/pages/orders/pending_orders_page.dart index 9544fa6..1060bf0 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 { From f1813b0443c10e2309687975aad3ba203b96a344 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 26 Aug 2020 10:08:14 +0300 Subject: [PATCH 6/7] fix login issue --- lib/core/service/client/base_app_client.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)}"); From 7029cc2dd6be3e3eac4b79eb309c35353bd255c6 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 26 Aug 2020 11:08:54 +0300 Subject: [PATCH 7/7] fix issues after merge --- lib/pages/dashboard/dashboard_screen.dart | 131 +++++++++++----------- 1 file changed, 64 insertions(+), 67 deletions(-) diff --git a/lib/pages/dashboard/dashboard_screen.dart b/lib/pages/dashboard/dashboard_screen.dart index 8a3cff3..360618f 100644 --- a/lib/pages/dashboard/dashboard_screen.dart +++ b/lib/pages/dashboard/dashboard_screen.dart @@ -1,20 +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/uitl/app_toast.dart'; -import 'package:driverapp/uitl/utils.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'; -import 'package:driverapp/widgets/others/app_scaffold_widget.dart'; class DashboardScreen extends StatefulWidget { @override @@ -385,70 +381,71 @@ class _DashboardScreenState extends State { 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( + 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.white, + maxRadius: 25.1, + child: Padding( + padding: const EdgeInsets.all(8.0), child: Text( - 'Olaya ST, Behind kfc next to king ,Olaya ST ', + '3 K.m \n away', 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.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), - ), - ), + color: Color(0xff30B7B9), + fontSize: 12.5, + fontWeight: FontWeight.w600), ), ), - ) - ], - ), - ), - ], + ), + ), + ) + ], + ), ), - ), - onTap: () => Navigator.push( - context, - MaterialPageRoute( - builder: (context) => OrdersListScreen()), - )), - ); - }), + ], + ), + ), + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + InformationPage(model.orders[index]))); + }, + ), + ); + }, + ), ) ], ),