diff --git a/lib/core/service/orders_service.dart b/lib/core/service/orders_service.dart index fbc4184..cf513e0 100644 --- a/lib/core/service/orders_service.dart +++ b/lib/core/service/orders_service.dart @@ -6,6 +6,7 @@ import 'package:driverapp/core/service/base_service.dart'; class OrdersService extends BaseService { List _orders = List(); + List get orders => _orders; bool isOrderInserted; diff --git a/lib/core/viewModels/orders_view_model.dart b/lib/core/viewModels/orders_view_model.dart index 6e3e6d1..8e25b6c 100644 --- a/lib/core/viewModels/orders_view_model.dart +++ b/lib/core/viewModels/orders_view_model.dart @@ -1,7 +1,7 @@ import 'package:driverapp/core/enum/viewstate.dart'; import 'package:driverapp/core/model/pending_orders/pending_orders_res_model.dart'; import 'package:driverapp/core/service/orders_service.dart'; -import 'package:driverapp/core/model/pending_orders/pending_orders_req_model.dart'; + import '../../locator.dart'; import 'base_view_model.dart'; diff --git a/lib/pages/dashboard/dashboard_screen.dart b/lib/pages/dashboard/dashboard_screen.dart index 0909123..e9e770f 100644 --- a/lib/pages/dashboard/dashboard_screen.dart +++ b/lib/pages/dashboard/dashboard_screen.dart @@ -91,8 +91,14 @@ class _DashboardScreenState extends State { Padding( padding: EdgeInsets.symmetric(horizontal: 10.0), child: Container( - height: MediaQuery.of(context).size.height * 0.15, - width: MediaQuery.of(context).size.width * 0.44, + height: MediaQuery + .of(context) + .size + .height * 0.15, + width: MediaQuery + .of(context) + .size + .width * 0.44, decoration: BoxDecoration( borderRadius: BorderRadius.circular(15.0), gradient: LinearGradient( @@ -105,7 +111,7 @@ class _DashboardScreenState extends State { padding: EdgeInsets.all(10.0), child: Column( mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.spaceBetween, children: [ Text( 'You Have', @@ -138,13 +144,15 @@ class _DashboardScreenState extends State { padding: EdgeInsets.only(right: 9.5), child: Image.asset( 'assets/images/closed_box.png', - height: MediaQuery.of(context) - .size - .height * + height: MediaQuery + .of(context) + .size + .height * 0.09, - width: MediaQuery.of(context) - .size - .width * + width: MediaQuery + .of(context) + .size + .width * 0.20, //fit: BoxFit.cover, )), @@ -165,7 +173,10 @@ class _DashboardScreenState extends State { padding: EdgeInsets.symmetric(horizontal: 10.0), child: Container( height: MediaQuery.of(context).size.height * 0.15, - width: MediaQuery.of(context).size.width * 0.44, + width: MediaQuery + .of(context) + .size + .width * 0.44, decoration: BoxDecoration( borderRadius: BorderRadius.circular(15.0), gradient: LinearGradient( @@ -179,7 +190,7 @@ class _DashboardScreenState extends State { padding: EdgeInsets.all(12.0), child: Column( mainAxisAlignment: - MainAxisAlignment.spaceEvenly, + MainAxisAlignment.spaceEvenly, children: [ Text( 'You Have', @@ -235,8 +246,14 @@ class _DashboardScreenState extends State { Expanded( child: InkWell( child: Container( - height: MediaQuery.of(context).size.height * 0.16, - width: MediaQuery.of(context).size.width * 0.50, + height: MediaQuery + .of(context) + .size + .height * 0.16, + width: MediaQuery + .of(context) + .size + .width * 0.50, decoration: BoxDecoration( borderRadius: BorderRadius.circular(15.0), gradient: LinearGradient(colors: [ @@ -252,9 +269,15 @@ class _DashboardScreenState extends State { Image.asset( 'assets/images/qr_code.png', width: - MediaQuery.of(context).size.width * 0.25, + MediaQuery + .of(context) + .size + .width * 0.25, height: - MediaQuery.of(context).size.height * 0.14, + MediaQuery + .of(context) + .size + .height * 0.14, fit: BoxFit.cover, ) ], @@ -328,10 +351,10 @@ class _DashboardScreenState extends State { ], ), onTap: () => Navigator.push( - context, - MaterialPageRoute( - builder: (context) => OrdersListScreen()), - )), + context, + MaterialPageRoute( + builder: (context) => OrdersListScreen()), + )), ], ), ], @@ -341,14 +364,17 @@ class _DashboardScreenState extends State { child: ListView.builder( shrinkWrap: true, scrollDirection: Axis.vertical, - itemCount: //model.orders == null ? 0 : model.orders.length, - 3, + itemCount: model.orders == null ? 0 : model.orders.length, +// 2, 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, + height: MediaQuery + .of(context) + .size + .height * 0.108, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -362,9 +388,15 @@ class _DashboardScreenState extends State { child: Image.asset( 'assets/images/location.png', height: - MediaQuery.of(context).size.height * - 0.10, - width: MediaQuery.of(context).size.width * + MediaQuery + .of(context) + .size + .height * + 0.10, + width: MediaQuery + .of(context) + .size + .width * 0.09, ), ) diff --git a/lib/pages/delivery/delivery_confirmed_page.dart b/lib/pages/delivery/delivery_confirmed_page.dart index 1d219e8..8fab34f 100644 --- a/lib/pages/delivery/delivery_confirmed_page.dart +++ b/lib/pages/delivery/delivery_confirmed_page.dart @@ -39,9 +39,22 @@ class DeliveryConfirmedPage extends StatelessWidget { child: Column( children: [ Container( - width: 300, - height: 300, - padding: EdgeInsets.only(top: 60), + width: MediaQuery + .of(context) + .size + .width, + //300, + height: MediaQuery + .of(context) + .size + .width * 0.7, + //300, + padding: EdgeInsets.only( + top: MediaQuery + .of(context) + .size + .width * 0.2, //60, + ), decoration: BoxDecoration( color: Colors.white10, shape: BoxShape.circle), @@ -81,12 +94,26 @@ class DeliveryConfirmedPage extends StatelessWidget { Stack( children: [ Container( - width: 400, - height: 500, + width: MediaQuery + .of(context) + .size + .width, //400, + height: MediaQuery + .of(context) + .size + .width, //500, ), Container( - width: 800, - height: 440, + width: MediaQuery + .of(context) + .size + .width, + //800, + height: MediaQuery + .of(context) + .size + .width * 1.2, + //440, margin: EdgeInsets.only(top: 60), decoration: BoxDecoration( color: Colors.white, @@ -99,7 +126,12 @@ class DeliveryConfirmedPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - margin: EdgeInsets.only(bottom: 50), + margin: EdgeInsets.only( + bottom: MediaQuery + .of(context) + .size + .width * 0.15, //50 + ), child: Column( children: [ FlatButton.icon( @@ -107,7 +139,7 @@ class DeliveryConfirmedPage extends StatelessWidget { color: Colors.orangeAccent, shape: RoundedRectangleBorder( borderRadius: - new BorderRadius.circular(10.0), + new BorderRadius.circular(10.0), ), icon: Icon( Icons.mode_edit, @@ -122,17 +154,29 @@ class DeliveryConfirmedPage extends StatelessWidget { onPressed: () {}, ), SizedBox( - height: 20, + height: MediaQuery + .of(context) + .size + .width * 0.1, //20, ), FlatButton( color: Color(0xff41bdbb), padding: - EdgeInsets.only(right: 100, left: 100), + EdgeInsets.only( + right: MediaQuery + .of(context) + .size + .width * 0.25, //100, + left: MediaQuery + .of(context) + .size + .width * 0.25, //100 + ), shape: RoundedRectangleBorder( borderRadius: - new BorderRadius.circular(18.0), + new BorderRadius.circular(18.0), side: - BorderSide(color: Color(0xff41bdbb)), + BorderSide(color: Color(0xff41bdbb)), ), child: Text( TranslationBase @@ -149,10 +193,13 @@ class DeliveryConfirmedPage extends StatelessWidget { ), ), CustomerBrief( - itemId: item.driverID, + itemId: item.patientID, customerFirstName: item.firstName, customerLastName: item.lastName, - mobileNo: item.mobileNumber), + mobileNo: item.mobileNumber, + totalPayment: item.amount, + deliveryTime: item.orderCreatedOn + ), ], ), ], diff --git a/lib/pages/delivery/information_page.dart b/lib/pages/delivery/information_page.dart index c0a9c1b..d6c6502 100644 --- a/lib/pages/delivery/information_page.dart +++ b/lib/pages/delivery/information_page.dart @@ -4,9 +4,6 @@ import 'package:driverapp/widgets/delivery/delivery_action_button.dart'; import 'package:driverapp/widgets/delivery/package_content.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:map_launcher/map_launcher.dart'; -import 'package:maps_launcher/maps_launcher.dart'; -import 'package:url_launcher/url_launcher.dart'; import '../../uitl/translations_delegate_base.dart'; import '../../widgets/others/app_scaffold_widget.dart'; @@ -18,215 +15,265 @@ class InformationPage extends StatelessWidget { @override Widget build(BuildContext context) { -// return AppScaffold( -// body: Center( -// child: InkWell(onTap: () {}, -// child: Texts('Replay Page')), -// ), -// ); return AppScaffold( body: Container( color: Color(0xff41bdbb), - child: ListView( - children: [ - Column( - children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - margin: EdgeInsets.only(right: 50), - child: IconButton( - color: Colors.white, - iconSize: 50, - icon: Icon(Icons.arrow_back), - onPressed: () { - Navigator.pop(context); - }, - ), - ), - Container( - child: Text( - TranslationBase.of(context).deliveryInfo, - style: TextStyle( + child: Container( + color: Color(0xff41bdbb), + child: ListView( + children: [ + Column( + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + margin: EdgeInsets.only( + right: MediaQuery + .of(context) + .size + .width * 0.15, //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, - ), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - delivery_info_button( - btnColor: Color(0xfff44336), - btnIcon: Icon( - Icons.near_me, - size: 30, - color: Colors.white, - ), - btnName: TranslationBase.of(context).location, - btnFunction: () { - MapsLauncher.launchCoordinates( - item.longitude, item.latitude); - }, - ), - 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: TranslationBase.of(context).sms, - btnFunction: () {}, - ), - delivery_info_button( - btnColor: Color(0xff41bdbb), - btnIcon: Icon( - Icons.phone, - size: 30, - color: Colors.white, - ), - btnName: TranslationBase.of(context).call, - btnFunction: () { - launch( - "tel://" + item.mobileNumber.toString()); - }, - ), - ], - ), - SizedBox( - height: 30, + Container( + child: Text( + TranslationBase + .of(context) + .deliveryInfo, + style: TextStyle( + color: Colors.white, + fontSize: 20, ), - Container( - margin: EdgeInsets.only(left: 15, right: 15), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + ), + ), + ], + ), + Stack( + children: [ + Container( + width: MediaQuery + .of(context) + .size + .width, //400, + height: MediaQuery + .of(context) + .size + .width, //500, + ), + Container( + width: MediaQuery + .of(context) + .size + .width * 1, + //800, + height: MediaQuery + .of(context) + .size + .width * 1.5, + //700, + margin: EdgeInsets.only( + top: MediaQuery + .of(context) + .size + .width * 0.3, //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: MediaQuery + .of(context) + .size + .width * 0.2, //170, + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, children: [ - Text( - TranslationBase.of(context).packageContent, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 20), + delivery_info_button( + btnColor: Color(0xfff44336), + btnIcon: Icon( + Icons.near_me, + size: 30, + color: Colors.white, + ), + btnName: TranslationBase + .of(context) + .location, + btnFunction: () {}, ), - SizedBox( - height: 20, + delivery_info_button( + btnColor: Colors.green, + btnIcon: Icon( + Icons.whatshot, + size: 30, + color: Colors.white, + ), + btnName: 'Whatsapp', + btnFunction: () {}, ), - package_content( - packageName: 'Panadol Extra 50 tablet', - packageCount: '5 box', + delivery_info_button( + btnColor: Colors.orangeAccent, + btnIcon: Icon( + Icons.mail_outline, + size: 30, + color: Colors.white, + ), + btnName: TranslationBase + .of(context) + .sms, + btnFunction: () {}, ), - 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(0xff41bdbb), + btnIcon: Icon( + Icons.phone, + size: 30, + color: Colors.white, + ), + btnName: TranslationBase + .of(context) + .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: MediaQuery + .of(context) + .size + .width * 0.1, //30, ), - child: Text( - TranslationBase.of(context).clientReached, - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold, - fontSize: 16), + Container( + margin: EdgeInsets.only( + left: MediaQuery + .of(context) + .size + .width * 0.05, //15, + right: MediaQuery + .of(context) + .size + .width * 0.02, //15 + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase + .of(context) + .packageContent, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 20), + ), + SizedBox( + height: MediaQuery + .of(context) + .size + .width * 0.05, //20, + ), + Column( + children: List.generate( + item.itemsQuantitiesList.length, + (index) { + return package_content( + packageName: item + .itemsQuantitiesList[index] + .itemName + .toString(), + //'Panadol Extra 50 tablet', + packageCount: item + .itemsQuantitiesList[index] + .quantity + .toString(), + ); + }), + ), + SizedBox( + height: MediaQuery + .of(context) + .size + .width * 0.01, //10, + ), + ], + ), ), - onPressed: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - DeliveryConfirmedPage(item))); - }, - ), - ], + SizedBox( + height: MediaQuery + .of(context) + .size + .width * 0.1, //30, + ), + FlatButton( + color: Color(0xff41bdbb), + padding: EdgeInsets.only( + right: MediaQuery + .of(context) + .size + .width * 0.3, //100, + left: MediaQuery + .of(context) + .size + .width * 0.3, //100, + bottom: MediaQuery + .of(context) + .size + .width * 0.035, //15, + top: MediaQuery + .of(context) + .size + .width * 0.035, //15 + ), + shape: RoundedRectangleBorder( + borderRadius: new BorderRadius.circular(30.0), + side: BorderSide(color: Color(0xff41bdbb)), + ), + child: Text( + TranslationBase + .of(context) + .clientReached, + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 16), + ), + onPressed: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + DeliveryConfirmedPage(item))); + }, + ), + ], + ), ), - ), - CustomerBrief( - itemId: item.driverID, - customerFirstName: item.firstName, - customerLastName: item.lastName, - mobileNo: item.mobileNumber, - latitude: item.latitude, - longitude: item.longitude, - ), - ], - ), - ], - ), - ], + CustomerBrief( + itemId: item.patientID, + customerFirstName: item.firstName, + customerLastName: item.lastName, + mobileNo: item.mobileNumber, + totalPayment: item.amount, + deliveryTime: item.orderCreatedOn), + ], + ), + ], + ), + ], + ), ), ), ); diff --git a/lib/pages/orders/pending_orders_page.dart b/lib/pages/orders/pending_orders_page.dart index d309f8e..69b59d4 100644 --- a/lib/pages/orders/pending_orders_page.dart +++ b/lib/pages/orders/pending_orders_page.dart @@ -1,9 +1,10 @@ -import 'package:flutter/material.dart'; -import 'package:driverapp/config/size_config.dart'; import 'package:driverapp/core/viewModels/orders_view_model.dart'; -import '../base/base_view.dart'; -import 'package:flutter/cupertino.dart'; +import 'package:driverapp/pages/delivery/information_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'; class OrdersListScreen extends StatefulWidget { @override @@ -17,125 +18,151 @@ class _OrdersListScreenState extends State { onModelReady: (model) => model.getPendingOrders(), builder: (BuildContext context, OrdersViewModel model, Widget child) => Scaffold( - appBar: AppBar( - centerTitle: true, - backgroundColor: Color(0xffF4F9FA), - title: Text( - 'Your Delivery Que', - ), - ), - body: Column( - children: [ - Center( - child: Text( - 'Nearest', - style: TextStyle( - color: Color(0xff30B7B9), - fontSize: 18.0, - fontWeight: FontWeight.w400), + appBar: AppBar( + centerTitle: true, + backgroundColor: Color(0xffF4F9FA), + title: Text( + 'Your Delivery Que', ), ), - 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: 1, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, + body: Column( + children: [ + Center( + child: Text( + 'Nearest', + style: TextStyle( + color: Color(0xff30B7B9), + fontSize: 18.0, + fontWeight: FontWeight.w400), + ), + ), + Expanded( + child: ListView.builder( + itemCount: model.orders == null ? 0 : model.orders.length, + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemBuilder: (BuildContext context, int index) { + return InkWell( + onTap: () { + Navigator.push( + context, MaterialPageRoute( + builder: (context) => + InformationPage(model.orders[index]))); + }, + child: 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: [ - Padding( - padding: EdgeInsets.only(left: 22.0), - child: Image.asset( - 'assets/images/location.png', - height: - MediaQuery.of(context).size.height * - 0.101, + Expanded( + flex: 1, + child: Column( + mainAxisAlignment: MainAxisAlignment + .center, + children: [ + Padding( + padding: EdgeInsets.only(left: 22.0), + child: Image.asset( + 'assets/images/location.png', + height: + MediaQuery + .of(context) + .size + .height * + 0.101, + ), + ), + ], ), ), - ], - ), - ), - if (model.orders.length != 0) - Expanded( - flex: 3, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only(top: 10.0), - 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), - ), + if (model.orders.length != 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.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', + flex: 3, + child: Column( + crossAxisAlignment: CrossAxisAlignment + .start, + children: [ + Padding( + padding: EdgeInsets.only(top: 10.0), + 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), - fontSize: 12.5, - fontWeight: FontWeight.w600), + 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.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/date_uitl.dart b/lib/uitl/date_uitl.dart index db73589..e050210 100644 --- a/lib/uitl/date_uitl.dart +++ b/lib/uitl/date_uitl.dart @@ -119,4 +119,14 @@ class DateUtil { else return ""; } + + + static String convertStringToHours(String date) { + DateTime stringDate = convertStringToDate(date); + DateTime dateTime = DateTime.parse(stringDate.toString()); + String hours = dateTime.toString(); + hours = hours.substring(10, 16); + return hours; + } + } diff --git a/lib/widgets/delivery/customer_brief_card.dart b/lib/widgets/delivery/customer_brief_card.dart index 89edb41..8ba11ea 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'; +import '../../uitl/date_uitl.dart'; import '../../uitl/translations_delegate_base.dart'; class CustomerBrief extends StatelessWidget { - final int itemId; + final String itemId; final String time; final String customerFirstName; final String customerLastName; @@ -121,7 +122,7 @@ class CustomerBrief extends StatelessWidget { width: 170, ), Text( - 'SAR 70', + totalPayment.toString(), //'SAR 70', style: TextStyle(fontWeight: FontWeight.bold), ), ], @@ -137,7 +138,12 @@ class CustomerBrief extends StatelessWidget { SizedBox( width: 50, ), - Text('05 Aug 20 - 10:00 AM', + Text( + '${DateUtil.getMonthDayYearDateFormatted( + DateUtil.convertStringToDate( + deliveryTime))} ${(DateUtil + .convertStringToHours(deliveryTime))}', + //'05 Aug 20 - 10:00 AM', style: TextStyle(fontWeight: FontWeight.bold)), ], )