diff --git a/lib/controller/firebase/firbase_messge.dart b/lib/controller/firebase/firbase_messge.dart index 7164e56..8dbbe75 100644 --- a/lib/controller/firebase/firbase_messge.dart +++ b/lib/controller/firebase/firbase_messge.dart @@ -769,6 +769,7 @@ class DriverTipWidget extends StatelessWidget { title: 'No i want'.tr, onPressed: () { box.write(BoxName.tipPercentage, '0'); + controller.update(); }), Container( decoration: AppStyle.boxDecoration1, diff --git a/lib/controller/home/captin/map_driver_controller.dart b/lib/controller/home/captin/map_driver_controller.dart index ca63f04..e7f596f 100644 --- a/lib/controller/home/captin/map_driver_controller.dart +++ b/lib/controller/home/captin/map_driver_controller.dart @@ -445,7 +445,7 @@ class MapDriverController extends GetxController { isRideFinished = true; isRideStarted = false; isPriceWindow = false; - totalCost = carType != 'Comfort' || carType != 'Mashwari' + totalCost = carType != 'Comfort' && carType != 'Mashwari' ? totalPassenger : price < double.parse(totalPassenger) ? totalPassenger diff --git a/lib/controller/home/map_passenger_controller.dart b/lib/controller/home/map_passenger_controller.dart index c6270c9..dc3a317 100644 --- a/lib/controller/home/map_passenger_controller.dart +++ b/lib/controller/home/map_passenger_controller.dart @@ -2311,6 +2311,7 @@ class MapPassengerController extends GetxController { } double costForDriver = 0; + double totalPassengerSpeed = 0; Future bottomSheet() async { if (data.isNotEmpty) { durationToAdd = Duration(seconds: durationToRide); @@ -2361,20 +2362,21 @@ class MapPassengerController extends GetxController { totalCostPassenger = totalDriver1 + (totalDriver1 * kazan / 100); totalPassenger = costSpeed + (costSpeed * kazan / 100); totalPassengerComfort = costComfort + (costComfort * kazan / 100); - // totalPassengerComfort = totalCostPassenger + (totalCostPassenger * .2); + totalPassengerSpeed = costSpeed + (costSpeed * kazan / 100); totalPassengerComfortDiscount = - totalPassengerComfort + totalPassengerComfort * (kazan - 4) / 100; + totalPassengerComfort + totalPassengerComfort * (kazan - 10) / 100; totalPassengerMotoDelivery = costDelivery + (costDelivery * kazan / 100); totalDriver = totalDriver1 + (totalDriver1 * kazan / 100); tax = totalCostPassenger * kazan / 100; totalME = totalCostPassenger - tax; costForDriver = fuelPrice * (20 / 210) * distance; - + print('cost for driver = $costForDriver'); if (totalCostPassenger < 20) { // for eygpt 20 le open ride totalCostPassenger = 20; + totalPassengerSpeed = 20; totalPassengerComfort = 30; - totalPassengerMotoDelivery = 20; + totalPassengerMotoDelivery = 18; } else { totalPassenger = totalCostPassenger; update(); diff --git a/lib/views/home/map_widget.dart/car_details_widget_to_go.dart b/lib/views/home/map_widget.dart/car_details_widget_to_go.dart index f3976bf..d6297ed 100644 --- a/lib/views/home/map_widget.dart/car_details_widget_to_go.dart +++ b/lib/views/home/map_widget.dart/car_details_widget_to_go.dart @@ -121,7 +121,7 @@ class CarDetailsTypeToChoose extends StatelessWidget { .toStringAsFixed(2) : carType.carType == 'Speed' ? mapPassengerController - .totalPassenger + .totalPassengerSpeed .toStringAsFixed(2) : carType.carType == 'Delivery' ? mapPassengerController @@ -136,14 +136,7 @@ class CarDetailsTypeToChoose extends StatelessWidget { children: [ Container( decoration: - const BoxDecoration( - color: AppColor - .greenColor, - borderRadius: - BorderRadius - .all(Radius - .circular( - 5))), + AppStyle.boxDecoration1, child: Text( '-12%', style: AppStyle.subtitle @@ -226,7 +219,8 @@ class CarDetailsTypeToChoose extends StatelessWidget { 1) { box.write(BoxName.carType, 'Speed'); mapPassengerController.totalPassenger = - mapPassengerController.totalPassenger; + mapPassengerController + .totalPassengerSpeed; Get.defaultDialog( title: 'Speed', titleStyle: AppStyle.title, diff --git a/lib/views/home/map_widget.dart/form_search_places_destenation.dart b/lib/views/home/map_widget.dart/form_search_places_destenation.dart index b022237..ecf3884 100644 --- a/lib/views/home/map_widget.dart/form_search_places_destenation.dart +++ b/lib/views/home/map_widget.dart/form_search_places_destenation.dart @@ -30,7 +30,7 @@ GetBuilder formSearchPlacesDestenation() { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Container( - width: Get.width * .7, + width: Get.width * .8, height: 40, decoration: const BoxDecoration( color: AppColor.secondaryColor), @@ -80,92 +80,92 @@ GetBuilder formSearchPlacesDestenation() { color: AppColor.greenColor, ), ), - IconButton( - onPressed: () async { - List recentLocations = await sql.getCustomQuery(''' - SELECT * FROM ${TableName.recentLocations} - ORDER BY id DESC - LIMIT 4 - '''); - Get.defaultDialog( - title: 'Latest Recent Trip'.tr, - content: recentLocations.isEmpty - ? Center( - child: Column( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - const Icon( - Icons.hourglass_empty_rounded, - size: 99, - color: AppColor.primaryColor, - ), - Text( - 'You Dont Have Any places yet !'.tr, - style: AppStyle.title, - ), - ], - ), - ) - : SizedBox( - height: Get.width * .5, - width: Get.width * .8, - child: ListView.builder( - itemCount: recentLocations.length, - itemBuilder: - (BuildContext context, int index) { - return Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - TextButton( - onPressed: () async { - Get.back(); - controller - .convertHintTextDestinationNewPlacesFromRecent( - recentLocations, - index); - }, - child: Text( - recentLocations[index] - ['name'], - style: AppStyle.title, - ), - ), - IconButton( - onPressed: () async { - await sql.deleteData( - TableName.placesFavorite, - recentLocations[index] - ['id']); - Get.back(); - // ignore: use_build_context_synchronously - Toast.show( - context, - '${'You are Delete'.tr} ${recentLocations[index]['name']} ${'from your list'.tr}', - AppColor.redColor); - // Get.snackbar('Deleted'.tr, - // '${'You are Delete'.tr} ${favoritePlaces[index]['name']} from your list', - // backgroundColor: - // AppColor.accentColor); - }, - icon: const Icon( - Icons.favorite_outlined), - ), - ], - ); - }, - ), - ), - ); - // controller.changeMainBottomMenuMap(); - // controller.changePickerShown(); - }, - icon: const Icon( - Icons.recent_actors, - color: AppColor.blueColor, - ), - ), + // IconButton( + // onPressed: () async { + // List recentLocations = await sql.getCustomQuery(''' + // SELECT * FROM ${TableName.recentLocations} + // ORDER BY id DESC + // LIMIT 4 + // '''); + // Get.defaultDialog( + // title: 'Latest Recent Trip'.tr, + // content: recentLocations.isEmpty + // ? Center( + // child: Column( + // mainAxisAlignment: + // MainAxisAlignment.center, + // children: [ + // const Icon( + // Icons.hourglass_empty_rounded, + // size: 99, + // color: AppColor.primaryColor, + // ), + // Text( + // 'You Dont Have Any places yet !'.tr, + // style: AppStyle.title, + // ), + // ], + // ), + // ) + // : SizedBox( + // height: Get.width * .5, + // width: Get.width * .8, + // child: ListView.builder( + // itemCount: recentLocations.length, + // itemBuilder: + // (BuildContext context, int index) { + // return Row( + // mainAxisAlignment: + // MainAxisAlignment.spaceBetween, + // children: [ + // TextButton( + // onPressed: () async { + // Get.back(); + // controller + // .convertHintTextDestinationNewPlacesFromRecent( + // recentLocations, + // index); + // }, + // child: Text( + // recentLocations[index] + // ['name'], + // style: AppStyle.title, + // ), + // ), + // IconButton( + // onPressed: () async { + // await sql.deleteData( + // TableName.placesFavorite, + // recentLocations[index] + // ['id']); + // Get.back(); + // // ignore: use_build_context_synchronously + // Toast.show( + // context, + // '${'You are Delete'.tr} ${recentLocations[index]['name']} ${'from your list'.tr}', + // AppColor.redColor); + // // Get.snackbar('Deleted'.tr, + // // '${'You are Delete'.tr} ${favoritePlaces[index]['name']} from your list', + // // backgroundColor: + // // AppColor.accentColor); + // }, + // icon: const Icon( + // Icons.favorite_outlined), + // ), + // ], + // ); + // }, + // ), + // ), + // ); + // // controller.changeMainBottomMenuMap(); + // // controller.changePickerShown(); + // }, + // icon: const Icon( + // Icons.recent_actors, + // color: AppColor.blueColor, + // ), + // ), ], ), SizedBox( diff --git a/lib/views/home/map_widget.dart/main_bottom_Menu_map.dart b/lib/views/home/map_widget.dart/main_bottom_Menu_map.dart index 08079a0..7849635 100644 --- a/lib/views/home/map_widget.dart/main_bottom_Menu_map.dart +++ b/lib/views/home/map_widget.dart/main_bottom_Menu_map.dart @@ -94,9 +94,10 @@ class MainBottomMenuMap extends StatelessWidget { ? const SizedBox() : Column( children: [ - controller.currentLocationToFormPlaces - ? const SizedBox() - : formSearchPlacesStart(), + // controller.currentLocationToFormPlaces + // ? const SizedBox() + // : + // formSearchPlacesStart(), formSearchPlacesDestenation(), const SizedBox( height: 10,