From 89fe5dfbdcf9a7210993187a64dade570447b8a0 Mon Sep 17 00:00:00 2001 From: enadhilal Date: Mon, 24 Aug 2020 12:37:03 +0300 Subject: [PATCH 1/4] 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/4] 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/4] 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/4] 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() ], ),