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(