diff --git a/lib/core/model/orders/pending_orders_req_model.dart b/lib/core/model/orders/pending_orders_req_model.dart index 782bddc..3db7263 100644 --- a/lib/core/model/orders/pending_orders_req_model.dart +++ b/lib/core/model/orders/pending_orders_req_model.dart @@ -10,6 +10,8 @@ class PendingOrders { String lastName; String mobileNumber; int distanceInKilometers; + String longitude; + String latitude; PendingOrders({ this.driverID, @@ -23,6 +25,8 @@ class PendingOrders { this.lastName, this.mobileNumber, this.distanceInKilometers, + this.longitude, + this.latitude, }); PendingOrders.fromJson(Map json) { @@ -48,6 +52,9 @@ class PendingOrders { data['TokenID'] = this.tokenID; data['UserID'] = this.userID; data['MobileNo'] = this.mobileNo; + data['Longitude'] = this.longitude; + data['Latitude'] = this.latitude; + return data; } } diff --git a/lib/core/service/orders_service.dart b/lib/core/service/orders_service.dart index d95c7fe..785ad1e 100644 --- a/lib/core/service/orders_service.dart +++ b/lib/core/service/orders_service.dart @@ -23,6 +23,8 @@ class OrdersService extends BaseService { searchKey: "", pageSize: 0, pageIndex: 0, + latitude: "24.640000", + longitude: "46.753000", ); DeliverdOrderModel _requestGetDeliverdOrders = DeliverdOrderModel( searchKey: "", diff --git a/lib/pages/dashboard/dashboard_screen.dart b/lib/pages/dashboard/dashboard_screen.dart index 8b9d0a5..867ddaa 100644 --- a/lib/pages/dashboard/dashboard_screen.dart +++ b/lib/pages/dashboard/dashboard_screen.dart @@ -6,6 +6,7 @@ import 'package:driverapp/core/viewModels/authentication_view_model.dart'; import 'package:driverapp/core/viewModels/orders_view_model.dart'; import 'package:driverapp/pages/delivery/information_page.dart'; import 'package:driverapp/pages/orders/pending_orders_page.dart'; +import 'package:driverapp/pages/setting/setting.dart'; import 'package:driverapp/uitl/app_toast.dart'; import 'package:driverapp/uitl/translations_delegate_base.dart'; import 'package:driverapp/uitl/utils.dart'; @@ -90,7 +91,8 @@ class _DashboardScreenState extends State { child: SafeArea( child: Column( children: [ - CircleAvatar( + InkWell( + child:CircleAvatar( radius: 25.5, backgroundColor: Color(0xff30B7B9), child: CircleAvatar( @@ -99,8 +101,15 @@ class _DashboardScreenState extends State { child: Image.asset( 'assets/images/driver.png', fit: BoxFit.contain, - ), + ),), ), + onTap: (){ + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + SettingPage(driverName:_authenticationViewModel.user.userName, driverID:_authenticationViewModel.user.userID))); + }, ), ], ), @@ -588,7 +597,7 @@ class _DashboardScreenState extends State { child: Text( model.orders[index].distanceInKilometers .toString() + - ' K.m\naway', + '\nK.m\naway', style: TextStyle( color: Color(0xff42B6AD), fontWeight: FontWeight.w800, diff --git a/lib/pages/delivery/delivery_confirmed_page.dart b/lib/pages/delivery/delivery_confirmed_page.dart index 70b49fd..24c367b 100644 --- a/lib/pages/delivery/delivery_confirmed_page.dart +++ b/lib/pages/delivery/delivery_confirmed_page.dart @@ -24,39 +24,41 @@ class DeliveryConfirmedPage extends StatelessWidget { return BaseView( builder: (_, model, w) => AppScaffold( isShowAppBar: true, - appBarColor: Theme.of(context).primaryColor, - arrowColor: Colors.white, - titleColor: Colors.white, - body: SafeArea( - child: Container( - color: Theme.of(context).primaryColor, - child: ListView( - children: [ - Stack( + appBarColor: Theme.of(context).primaryColor, + arrowColor: Colors.white, + titleColor: Colors.white, + body: SafeArea( + child: Container( + color: Theme.of(context).primaryColor, + child: ListView( + children: [ + Stack( children: [ Column( children: [ Container( - child: Column( - children: [ - Container( - width: MediaQuery.of(context).size.width, - height: MediaQuery.of(context).size.width * 0.7, - padding: EdgeInsets.only( - top: MediaQuery.of(context).size.width * 0.12, - ), - decoration: BoxDecoration( - color: Colors.white10, shape: BoxShape.circle), - child: Column( - children: [ - Icon( - Icons.check_circle, - color: Colors.white, - size: 75, - ), - SizedBox( - height: - MediaQuery.of(context).size.width * 0.03, + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width, + height: MediaQuery.of(context).size.width * 0.7, + padding: EdgeInsets.only( + top: MediaQuery.of(context).size.width * 0.12, + ), + decoration: BoxDecoration( + color: Colors.white10, + shape: BoxShape.circle), + child: Column( + children: [ + Icon( + Icons.check_circle, + color: Colors.white, + size: 75, + ), + SizedBox( + height: + MediaQuery.of(context).size.width * + 0.03, ), Text( TranslationBase.of(context).deliveryInfo, @@ -138,31 +140,32 @@ class DeliveryConfirmedPage extends StatelessWidget { .nextDelivery, loading: model.state == ViewState.BusyLocal, onTap: () { - getNextOrder(context, model); - },), - ), - ], + getNextOrder(context, model);}, + ), + ), + ], + ), ), - ), - ], + ], + ), ), - ), - Container( - margin: EdgeInsets.only( + Container( + margin: EdgeInsets.only( top: MediaQuery.of(context).size.width * 0.6, + ), + child: CustomerBriefCard( + itemId: item.orderID, + customerFirstName: item.firstName, + customerLastName: item.lastName, + mobileNo: item.mobileNumber, + totalPayment: item.amount, + showDistance: false, + deliveryTime: item.orderCreatedOn), ), - child: CustomerBriefCard( - itemId: item.orderID, - customerFirstName: item.firstName, - customerLastName: item.lastName, - mobileNo: item.mobileNumber, - totalPayment: item.amount, - showDistance: false, - deliveryTime: item.orderCreatedOn), - ), - ], - ), - ],), + ], + ), + ], + ), ), ), ), diff --git a/lib/pages/delivery/information_page.dart b/lib/pages/delivery/information_page.dart index 580232b..3a13967 100644 --- a/lib/pages/delivery/information_page.dart +++ b/lib/pages/delivery/information_page.dart @@ -1 +1 @@ -import 'package:driverapp/app-icons/driver_app_icons.dart'; import 'package:driverapp/core/enum/viewstate.dart'; import 'package:driverapp/core/model/orders/pending_orders_res_model.dart'; import 'package:driverapp/core/model/orders/update_order_status_request_model.dart'; import 'package:driverapp/core/viewModels/orders_view_model.dart'; import 'package:driverapp/pages/base/base_view.dart'; import 'package:driverapp/pages/delivery/delivery_confirmed_page.dart'; import 'package:driverapp/uitl/utils.dart'; import 'package:driverapp/widgets/bottom_sheet/action_sheet_button.dart'; import 'package:driverapp/widgets/buttons/secondary_button.dart'; import 'package:driverapp/widgets/data_display/dialog/custom_dialog.dart'; import 'package:driverapp/widgets/data_display/text.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'; import 'package:hexcolor/hexcolor.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'; class InformationPage extends StatelessWidget { final PendingOrdersRes item; int orderStatus; InformationPage(this.item); @override Widget build(BuildContext context) { showDeliveryOptions(OrdersViewModel model) { showModalBottomSheet( backgroundColor: Colors.white, shape: RoundedRectangleBorder( borderRadius: BorderRadius.only( topLeft: Radius.circular(50.0), topRight: Radius.circular(50.0), ), ), context: context, builder: (BuildContext bc) { return ListView( children: [ Container( decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.only( topLeft: Radius.circular(50.0), topRight: Radius.circular(50.0), ), ), child: Column( mainAxisSize: MainAxisSize.min, children: [ SizedBox( height: 10, ), Center( child: Texts( TranslationBase.of(context).selectAction, color: Colors.black, fontSize: 22, ), ), SizedBox( height: 10, ), FractionallySizedBox( widthFactor: MediaQuery.of(context).orientation == Orientation.portrait ? 0.9 : 0.98, child: Container( height: MediaQuery.of(context).size.height * 0.45, decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.only( topLeft: Radius.circular(50.0), topRight: Radius.circular(50.0), ), ), width: double.infinity, child: ListView( children: [ Column( children: [ SizedBox( height: 3, child: Container( color: Hexcolor("#D5D5D5"), ), ), SizedBox( height: 15, ), ActionSheetButton( label: TranslationBase.of(context).delivered, icon: DriverApp.deliverd_icon, onTap: () { selectAction(context, 3, model); }, ), SizedBox(height: 15), ActionSheetButton( label: TranslationBase.of(context) .deliveredAccepted, icon: DriverApp.not_available, onTap: () { selectAction(context, 4, model); }, ), SizedBox(height: 15), ActionSheetButton( label: TranslationBase.of(context) .deliveredRejected, icon: DriverApp.rejected_icon, onTap: () { selectAction(context, 5, model); }, ), SizedBox(height: 15), ActionSheetButton( label: TranslationBase.of(context).canceled, icon: DriverApp.not_reachable_icon, onTap: () { selectAction(context, 6, model); }, ), SizedBox(height: 15), ], ), ], ), )) ], ), ), ], ); }); } return BaseView( builder: (_, model, w) => AppScaffold( isShowAppBar: true, appBarColor: Color(0xff45B7AE), arrowColor: Colors.white, titleColor: Colors.white, appBarTitle: TranslationBase.of(context).deliveryInfo, body: Container( color: Colors.red, child: Container( color: Color(0xff45B7AE), child: ListView( children: [ Column( children: [ Stack( children: [ // Container( // width: MediaQuery.of(context).size.width, // height: MediaQuery.of(context).size.width, // ), Container( width: MediaQuery .of(context) .size .width * 1, height: MediaQuery.of(context).orientation == Orientation.portrait ? MediaQuery.of(context).size.width * 1.5 : MediaQuery.of(context).size.width * 0.8, margin: EdgeInsets.only( top: MediaQuery.of(context).orientation == Orientation.portrait ? MediaQuery.of(context).size.width * 0.23 : MediaQuery.of(context).size.width * 0.13), decoration: BoxDecoration( color: Theme.of(context).scaffoldBackgroundColor, 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.23, //MediaQuery.of(context).size.width * 0.005, ), Row( mainAxisAlignment: MainAxisAlignment.center, children: [ DeliveryInfoButton( btnColor: Colors.white, //Color(0xffED1C24), btnIcon: Icon(DriverApp.location_1, size: MediaQuery.of(context) .orientation == Orientation.portrait ? 40 : 90, color: Color(0xffED1C24)), btnName: TranslationBase.of(context).location, btnFunction: () { MapsLauncher.launchCoordinates( item.latitude, item.longitude); }, ), DeliveryInfoButton( btnColor: Colors.white, //Color(0xFF61B260), btnIcon: Icon( DriverApp.whatsapp, size: MediaQuery.of(context).orientation == Orientation.portrait ? 40 : 90, color: Color(0xFF61B260), ), btnName: 'Whatsapp', btnFunction: () {}, ), DeliveryInfoButton( btnColor: Colors.white, //Color(0xFFFCB657), btnIcon: Icon( DriverApp.message, size: MediaQuery.of(context).orientation == Orientation.portrait ? 40 : 90, color: Color(0xFFFCB657), ), btnName: TranslationBase.of(context).sms, btnFunction: () {}, ), DeliveryInfoButton( btnColor: Colors .white, //Theme.of(context).primaryColor, btnIcon: Icon( DriverApp.call, size: MediaQuery.of(context).orientation == Orientation.portrait ? 40 : 90, color: Theme.of(context).primaryColor, ), btnName: TranslationBase.of(context).call, btnFunction: () => launch("tel://" + item.mobileNumber), ), ], ), SizedBox( height: MediaQuery.of(context).size.width * 0.08, ), Container( margin: EdgeInsets.only( left: MediaQuery .of(context) .size .width * 0.05, right: MediaQuery .of(context) .size .width * 0.05, ), child: Column( crossAxisAlignment: CrossAxisAlignment .start, children: [ Padding( padding: const EdgeInsets.only( left: 8), child: Text( TranslationBase .of(context) .packageContent, style: TextStyle( fontWeight: FontWeight.w900, fontSize: 20), ), ), SizedBox( height: MediaQuery .of(context) .size .width * 0.05, ), Padding( padding: const EdgeInsets.only( left: 10), child: Column( children: List.generate( item.itemsQuantitiesList != null ? item .itemsQuantitiesList.length : 0, (index) { return packageContent( packageName: item .itemsQuantitiesList[index] .itemName .toString(), packageCount: item .itemsQuantitiesList[index] .quantity .toString(), ); }), ), ), SizedBox( height: MediaQuery .of(context) .size .width * 0.01, ), ], ), ), SizedBox( height: MediaQuery.of(context).size.width * 0.1, ), Container( margin: EdgeInsets.all(10), child: SecondaryButton( label: TranslationBase.of(context).clientReached, onTap: () { showDeliveryOptions(model); }, ), ), ], ), ), CustomerBriefCard( itemId: item.orderID, customerFirstName: item.firstName, customerLastName: item.lastName, mobileNo: item.mobileNumber, totalPayment: item.amount, deliveryTime: item.orderCreatedOn, longitude: item.longitude, latitude: item.latitude, ), ], ), ], ), ], ), ), ), ), ); } selectAction(BuildContext context, orderStatus, OrdersViewModel model) { String orderStatusText; this.orderStatus = orderStatus; switch (orderStatus) { case 3: orderStatusText = TranslationBase.of(context).delivered; break; case 4: orderStatusText = TranslationBase.of(context).deliveredAccepted; break; case 5: orderStatusText = TranslationBase.of(context).deliveredRejected; break; case 6: orderStatusText = TranslationBase.of(context).canceled; break; } showDialog( context: context, builder: (BuildContext context) { return CustomDialog( orderStatusText: orderStatusText, callService: () { updateOrderStatus(context, model); }, model: model, ); }); } updateOrderStatus(BuildContext context, OrdersViewModel model) async { UpdateOrderStatusRequestModel updateOrderStatusRequestModel = UpdateOrderStatusRequestModel( deliveryOrderID: item.orderID, deliveryOrderStatus: orderStatus, rejectionReason: "NO Reason", cancleReason: ""); await model.updateOrderStatus(updateOrderStatusRequestModel); if (model.state == ViewState.ErrorLocal) { Utils.showErrorToast(model.error); Navigator.of(context).pop(); model.hideBottomSheet(); } else { Navigator.of(context).pop(); model.hideBottomSheet(); Navigator.pushReplacement( context, MaterialPageRoute( builder: (context) => DeliveryConfirmedPage(item), ), ); } } } \ No newline at end of file +import 'package:driverapp/app-icons/driver_app_icons.dart'; import 'package:driverapp/core/enum/viewstate.dart'; import 'package:driverapp/core/model/orders/pending_orders_res_model.dart'; import 'package:driverapp/core/model/orders/update_order_status_request_model.dart'; import 'package:driverapp/core/viewModels/orders_view_model.dart'; import 'package:driverapp/pages/base/base_view.dart'; import 'package:driverapp/pages/delivery/delivery_confirmed_page.dart'; import 'package:driverapp/uitl/utils.dart'; import 'package:driverapp/widgets/bottom_sheet/action_sheet_button.dart'; import 'package:driverapp/widgets/buttons/secondary_button.dart'; import 'package:driverapp/widgets/data_display/dialog/custom_dialog.dart'; import 'package:driverapp/widgets/data_display/text.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'; import 'package:hexcolor/hexcolor.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'; class InformationPage extends StatelessWidget { final PendingOrdersRes item; int orderStatus; InformationPage(this.item); @override Widget build(BuildContext context) { showDeliveryOptions(OrdersViewModel model) { showModalBottomSheet( backgroundColor: Colors.white, shape: RoundedRectangleBorder( borderRadius: BorderRadius.only( topLeft: Radius.circular(50.0), topRight: Radius.circular(50.0), ), ), context: context, builder: (BuildContext bc) { return ListView( children: [ Container( decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.only( topLeft: Radius.circular(50.0), topRight: Radius.circular(50.0), ), ), child: Column( mainAxisSize: MainAxisSize.min, children: [ SizedBox( height: 10, ), Center( child: Texts( TranslationBase.of(context).selectAction, color: Colors.black, fontSize: 22, ), ), SizedBox( height: 10, ), FractionallySizedBox( widthFactor: MediaQuery.of(context).orientation == Orientation.portrait ? 0.9 : 0.98, child: Container( height: MediaQuery.of(context).size.height * 0.45, decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.only( topLeft: Radius.circular(50.0), topRight: Radius.circular(50.0), ), ), width: double.infinity, child: ListView( children: [ Column( children: [ SizedBox( height: 3, child: Container( color: Hexcolor("#D5D5D5"), ), ), SizedBox( height: 15, ), ActionSheetButton( label: TranslationBase.of(context).delivered, icon: DriverApp.deliverd_icon, onTap: () { selectAction(context, 3, model); }, ), SizedBox(height: 15), ActionSheetButton( label: TranslationBase.of(context) .deliveredAccepted, icon: DriverApp.not_available, onTap: () { selectAction(context, 4, model); }, ), SizedBox(height: 15), ActionSheetButton( label: TranslationBase.of(context) .deliveredRejected, icon: DriverApp.rejected_icon, onTap: () { selectAction(context, 5, model); }, ), SizedBox(height: 15), ActionSheetButton( label: TranslationBase.of(context).canceled, icon: DriverApp.not_reachable_icon, onTap: () { selectAction(context, 6, model); }, ), SizedBox(height: 15), ], ), ], ), )) ], ), ), ], ); }); } return BaseView( builder: (_, model, w) => AppScaffold( isShowAppBar: true, appBarColor: Color(0xff45B7AE), arrowColor: Colors.white, titleColor: Colors.white, appBarTitle: TranslationBase.of(context).deliveryInfo, body: Container( color: Colors.red, child: Container( color: Color(0xff45B7AE), child: ListView( children: [ Column( children: [ Stack( children: [ // Container( // width: MediaQuery.of(context).size.width, // height: MediaQuery.of(context).size.width, // ), Container( width: MediaQuery .of(context) .size .width * 1, height: MediaQuery.of(context).orientation == Orientation.portrait ? MediaQuery.of(context).size.width * 1.5 : MediaQuery.of(context).size.width * 0.9, margin: EdgeInsets.only( top: MediaQuery.of(context).orientation == Orientation.portrait ? MediaQuery.of(context).size.width * 0.23 : MediaQuery.of(context).size.width * 0.13), decoration: BoxDecoration( color: Theme.of(context).scaffoldBackgroundColor, 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.23, //MediaQuery.of(context).size.width * 0.005, ), Row( mainAxisAlignment: MainAxisAlignment.center, children: [ DeliveryInfoButton( btnColor: Colors.white, //Color(0xffED1C24), btnIcon: Icon(DriverApp.location_1, size: MediaQuery.of(context) .orientation == Orientation.portrait ? 50 : 90, color: Color(0xffED1C24)), btnName: TranslationBase.of(context).location, btnFunction: () { MapsLauncher.launchCoordinates( item.latitude, item.longitude); }, ), DeliveryInfoButton( btnColor: Colors.white, //Color(0xFF61B260), btnIcon: Icon( DriverApp.whatsapp, size: MediaQuery.of(context).orientation == Orientation.portrait ? 50 : 90, color: Color(0xFF5EA34A), ), btnName: 'Whatsapp', btnFunction: () {}, ), DeliveryInfoButton( btnColor: Colors.white, //Color(0xFFFCB657), btnIcon: Icon( DriverApp.message, size: MediaQuery.of(context).orientation == Orientation.portrait ? 50 : 90, color: Color(0xffFFA540), ), btnName: TranslationBase.of(context).sms, btnFunction: () {}, ), DeliveryInfoButton( btnColor: Colors .white, //Theme.of(context).primaryColor, btnIcon: Icon( DriverApp.call, size: MediaQuery.of(context).orientation == Orientation.portrait ? 50 : 90, color: Theme.of(context).primaryColor, ), btnName: TranslationBase.of(context).call, btnFunction: () => launch("tel://" + item.mobileNumber), ), ], ), SizedBox( height: MediaQuery.of(context).size.width * 0.08, ), Container( margin: EdgeInsets.only( left: MediaQuery .of(context) .size .width * 0.05, right: MediaQuery .of(context) .size .width * 0.05, ), child: Column( crossAxisAlignment: CrossAxisAlignment .start, children: [ Padding( padding: const EdgeInsets.only( left: 8), child: Text( TranslationBase .of(context) .packageContent, style: TextStyle( fontWeight: FontWeight.w900, fontSize: 20), ), ), SizedBox( height: MediaQuery .of(context) .size .width * 0.05, ), Padding( padding: const EdgeInsets.only( left: 10), child: Column( children: List.generate( item.itemsQuantitiesList != null ? item .itemsQuantitiesList.length : 0, (index) { return packageContent( packageName: item .itemsQuantitiesList[index] .itemName .toString(), packageCount: item .itemsQuantitiesList[index] .quantity .toString(), ); }), ), ), SizedBox( height: MediaQuery .of(context) .size .width * 0.01, ), ], ), ), SizedBox( height: MediaQuery.of(context).size.width * 0.1, ), Container( margin: EdgeInsets.all(10), child: SecondaryButton( label: TranslationBase.of(context).clientReached, onTap: () { showDeliveryOptions(model); }, ), ), ], ), ), CustomerBriefCard( itemId: item.orderID, customerFirstName: item.firstName, customerLastName: item.lastName, mobileNo: item.mobileNumber, totalPayment: item.amount, deliveryTime: item.orderCreatedOn, longitude: item.longitude, latitude: item.latitude, ), ], ), ], ), ], ), ), ), ), ); } selectAction(BuildContext context, orderStatus, OrdersViewModel model) { String orderStatusText; this.orderStatus = orderStatus; switch (orderStatus) { case 3: orderStatusText = TranslationBase.of(context).delivered; break; case 4: orderStatusText = TranslationBase.of(context).deliveredAccepted; break; case 5: orderStatusText = TranslationBase.of(context).deliveredRejected; break; case 6: orderStatusText = TranslationBase.of(context).canceled; break; } showDialog( context: context, builder: (BuildContext context) { return CustomDialog( orderStatusText: orderStatusText, callService: () { updateOrderStatus(context, model); }, model: model, ); }); } updateOrderStatus(BuildContext context, OrdersViewModel model) async { UpdateOrderStatusRequestModel updateOrderStatusRequestModel = UpdateOrderStatusRequestModel( deliveryOrderID: item.orderID, deliveryOrderStatus: orderStatus, rejectionReason: "NO Reason", cancleReason: ""); await model.updateOrderStatus(updateOrderStatusRequestModel); if (model.state == ViewState.ErrorLocal) { Utils.showErrorToast(model.error); Navigator.of(context).pop(); model.hideBottomSheet(); } else { Navigator.of(context).pop(); model.hideBottomSheet(); Navigator.pushReplacement( context, MaterialPageRoute( builder: (context) => DeliveryConfirmedPage(item), ), ); } } } \ No newline at end of file diff --git a/lib/pages/orders/pending_orders_page.dart b/lib/pages/orders/pending_orders_page.dart index e926443..50eb090 100644 --- a/lib/pages/orders/pending_orders_page.dart +++ b/lib/pages/orders/pending_orders_page.dart @@ -115,7 +115,7 @@ class _OrdersListScreenState extends State { child: Text( model.orders[index].distanceInKilometers .toString() + - ' K.m\naway', + '\nK.m\naway', style: TextStyle( color: Color(0xff42B6AD), fontWeight: FontWeight.w800, diff --git a/lib/pages/setting/setting.dart b/lib/pages/setting/setting.dart new file mode 100644 index 0000000..c084d7f --- /dev/null +++ b/lib/pages/setting/setting.dart @@ -0,0 +1,163 @@ +import 'package:driverapp/uitl/translations_delegate_base.dart'; +import 'package:driverapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + + +class SettingPage extends StatelessWidget { + final String driverName;//_authenticationViewModel.user.userName + final int driverID; + + SettingPage({this.driverName, this.driverID}); + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarColor: Color(0xff30B7B9), + arrowColor: Colors.white, + titleColor: Colors.white, + body: SingleChildScrollView( + child: Column( + children: [ + Container( + width: double.infinity, + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width, + height: MediaQuery.of(context).size.width * 0.7, + child: CircleAvatar( + radius: 25.5, + backgroundColor: Theme.of(context).primaryColor, + child: CircleAvatar( + backgroundColor: Theme.of(context).primaryColor, + maxRadius: 200.0, + child: Image.asset( + 'assets/images/driver.png', + height: MediaQuery.of(context).size.width * 1 , + width: MediaQuery.of(context).size.width * 1, + fit: BoxFit.contain, + ), + ), + ), + ), + SizedBox(height: MediaQuery.of(context).size.width *0.05,), + Container( + child: Text( + driverName, + style: TextStyle( + fontSize: 40, + fontWeight: FontWeight.w600, + color: Colors.white + ), + ), + ), + SizedBox(height: MediaQuery.of(context).size.width *0.05,), + Container( + child: Text( + 'ID: ${driverID.toString()}', + style: TextStyle( + fontSize: 20, + color: Colors.white + ), + ), + ), + ], + ), + ), + SizedBox(height: MediaQuery.of(context).size.width *0.1,), + Container( + margin: EdgeInsets.only(left: 35), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + InkWell( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(left: 15), + child: Row( + children: [ + Icon( + Icons.input, + size: 40, + color: Colors.white, + ), + SizedBox(width: MediaQuery.of(context).size.width *0.05,), + Text( + TranslationBase.of(context).logout, + style: TextStyle( + fontWeight: FontWeight.w500, + color: Colors.white, + fontSize: 18 + ), + ), + ], + ), + ), + SizedBox( + height: MediaQuery.of(context).size.width *0.05, + child: Center( + child: Container( + margin: EdgeInsetsDirectional.only(start: 0, end: 30), + height: 1.0, + color: Colors.white, + ), + ), + ), + ], + ), + ), + SizedBox(height: MediaQuery.of(context).size.width*0.05,), + InkWell( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(left: 15), + child: Row( + children: [ + Icon( + Icons.settings, + size: 40, + color: Colors.white, + ), + SizedBox( + width: MediaQuery.of(context).size.width * 0.05, + ), + Text( + TranslationBase.of(context).settings, + style: TextStyle( + fontWeight: FontWeight.w500, + color: Colors.white, + fontSize: 18 + ), + ), + ], + ), + ), + SizedBox( + height: 10.0, + child: Center( + child: Container( + margin: EdgeInsetsDirectional.only(start: 0, end: 30), + height: 1.0, + color: Colors.white, + ), + ), + ), + SizedBox(height: MediaQuery.of(context).size.width*0.05,), + ], + ), + ), + ], + ), + ), + ], + ), + ), + ); + } +} \ No newline at end of file diff --git a/lib/widgets/data_display/circle-container.dart b/lib/widgets/data_display/circle-container.dart index bb0ebdd..02efbdf 100644 --- a/lib/widgets/data_display/circle-container.dart +++ b/lib/widgets/data_display/circle-container.dart @@ -26,8 +26,8 @@ class CircleContainer extends StatelessWidget { color: color, border: Border.all( color: borderColor ?? Hexcolor("#707070"), width: borderWidth)), - height: 60, - width: 60, + height: 80, + width: 80, ), ); } diff --git a/lib/widgets/delivery/customer_brief_card.dart b/lib/widgets/delivery/customer_brief_card.dart index 1dcba37..9e39e7f 100644 --- a/lib/widgets/delivery/customer_brief_card.dart +++ b/lib/widgets/delivery/customer_brief_card.dart @@ -66,7 +66,10 @@ class CustomerBriefCard extends StatelessWidget { flex: 3, child: Text( 'ID: ${itemId}', - style: TextStyle(color: Color(0xFFADACAD)), + style: TextStyle( + color: Color(0xFFADACAD), + fontWeight: FontWeight.w800, + fontSize: 17.5), ), ), Expanded( @@ -91,7 +94,7 @@ class CustomerBriefCard extends StatelessWidget { ), Text( '${customerFirstName} ${customerLastName}', - style: TextStyle(fontSize: 20, fontWeight: FontWeight.w900), + style: TextStyle(fontSize: 20, fontWeight: FontWeight.w500), ), SizedBox( height: MediaQuery.of(context).size.width * 0.019, @@ -142,7 +145,7 @@ class CustomerBriefCard extends StatelessWidget { child: Text( totalPayment.toString(), textAlign: TextAlign.end, - style: TextStyle(fontWeight: FontWeight.w600), + style: TextStyle(fontWeight: FontWeight.w400), ), ), ], @@ -163,7 +166,7 @@ class CustomerBriefCard extends StatelessWidget { child: Text( '${DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(deliveryTime))} ${(DateUtil.convertStringToHours(deliveryTime))}', textAlign: TextAlign.end, - style: TextStyle(fontWeight: FontWeight.w600)), + style: TextStyle(fontWeight: FontWeight.w400)), ), ], ) diff --git a/lib/widgets/delivery/delivery_action_button.dart b/lib/widgets/delivery/delivery_action_button.dart index 00ea320..7a25e6e 100644 --- a/lib/widgets/delivery/delivery_action_button.dart +++ b/lib/widgets/delivery/delivery_action_button.dart @@ -12,25 +12,19 @@ class DeliveryInfoButton extends StatelessWidget { Widget build(BuildContext context) { print(btnColor); return Padding( - padding: EdgeInsets.all(8.0), + padding: MediaQuery.of(context).orientation == Orientation.portrait + ? EdgeInsets.all(4.0) + : EdgeInsets.all(7.0), child: Column( children: [ SizedBox( - height: MediaQuery - .of(context) - .size - .width * 0.14, - width: MediaQuery - .of(context) - .size - .width * 0.165, // specific value - child: - InkWell( - child: btnIcon, + height: MediaQuery.of(context).size.width * 0.14, + width: MediaQuery.of(context).size.width * 0.165, // specific value + child: InkWell( + child: btnIcon, onTap: btnFunction, ), ), - Text( btnName, style: TextStyle( @@ -42,4 +36,4 @@ class DeliveryInfoButton extends StatelessWidget { ), ); } -} \ No newline at end of file +}