diff --git a/lib/constant/colors.dart b/lib/constant/colors.dart index c9b90f2..8080df3 100644 --- a/lib/constant/colors.dart +++ b/lib/constant/colors.dart @@ -4,6 +4,8 @@ class AppColor { static const Color primaryColor = Colors.black; static const Color secondaryColor = Colors.white; static const Color accentColor = Colors.grey; - static const Color redColor = Color.fromARGB(255, 199, 56, 46); - static const Color greenColor = Color.fromARGB(255, 43, 225, 43); + static const Color redColor = Color(0xFFEA4335); // Google Red + static const Color greenColor = Color(0xFF34A853); // Google Green + static const Color blueColor = Color(0xFF4285F4); // Google Blue + static const Color yellowColor = Color(0xFFFBBC05); // Google Yellow } diff --git a/lib/constant/info.dart b/lib/constant/info.dart index ede63cd..7305137 100644 --- a/lib/constant/info.dart +++ b/lib/constant/info.dart @@ -1,5 +1,6 @@ -class Fleek { - static const String companyName = 'Fleek-tech'; +class AppInfo { + static const String companyName = 'Mobile-App'; + static const String appName = 'SEFER'; static const String phoneNumber = '962798583052'; static const String linkedInProfile = 'https://www.linkedin.com/in/hamza-ayed/'; diff --git a/lib/constant/links.dart b/lib/constant/links.dart index 3cb1fa2..cd302f9 100644 --- a/lib/constant/links.dart +++ b/lib/constant/links.dart @@ -51,6 +51,8 @@ class AppLink { //==================certifcate========== static const String location = '$server/ride/location'; static const String getCarsLocationByPassenger = "$location/get.php"; + static const String getDriverCarsLocationToPassengerAfterApplied = + "$location/getDriverCarsLocationToPassengerAfterApplied.php"; static const String addCarsLocationByPassenger = "$location/add.php"; static const String deleteCarsLocationByPassenger = "$location/delete.php"; static const String updateCarsLocationByPassenger = "$location/update.php"; diff --git a/lib/constant/style.dart b/lib/constant/style.dart index e688c25..cda379a 100644 --- a/lib/constant/style.dart +++ b/lib/constant/style.dart @@ -28,4 +28,24 @@ class AppStyle { fontSize: 20, color: AppColor.primaryColor, fontFamily: GoogleFonts.josefinSans().fontFamily); + + static BoxDecoration boxDecoration() { + return const BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(12)), + color: AppColor.secondaryColor, + boxShadow: [ + BoxShadow( + color: AppColor.accentColor, + offset: Offset(-3, -3), + blurRadius: 0, + spreadRadius: 0, + blurStyle: BlurStyle.outer), + BoxShadow( + color: AppColor.accentColor, + offset: Offset(3, 3), + blurRadius: 0, + spreadRadius: 0, + blurStyle: BlurStyle.outer) + ]); + } } diff --git a/lib/controller/firebase/firbase_messge.dart b/lib/controller/firebase/firbase_messge.dart index d9eb7cb..f12314d 100644 --- a/lib/controller/firebase/firbase_messge.dart +++ b/lib/controller/firebase/firbase_messge.dart @@ -282,9 +282,75 @@ class FirebasMessagesController extends GetxController { ) ], )); - } else if (message.notification!.title!.contains('Promo')) { - Get.to(const PromosPassengerPage()); } + } else if (message.notification!.title!.contains('Apply Ride')) { + // MapController().rideConfirm = true; + var passengerList = message.data['passengerList']; + print(passengerList); + print('9999999999999my Apply Ride 999999999999999'); + var myList = jsonDecode(passengerList) as List; + driverID = myList[2].toString(); + Get.snackbar( + 'Captin Applied the Ride for You'.tr, + 'message', + colorText: AppColor.greenColor, + duration: const Duration(seconds: 11), + instantInit: true, + snackPosition: SnackPosition.TOP, + titleText: Text( + 'Applied'.tr, + style: const TextStyle(color: AppColor.redColor), + ), + messageText: Text( + 'Captin Applied the Ride for You'.tr, + style: AppStyle.title, + ), + icon: const Icon(Icons.approval), + shouldIconPulse: true, + maxWidth: double.infinity, + margin: const EdgeInsets.all(16), + padding: const EdgeInsets.all(16), + borderRadius: 8, + borderColor: AppColor.primaryColor, + borderWidth: 2, + backgroundColor: AppColor.secondaryColor, + leftBarIndicatorColor: AppColor.greenColor, + boxShadows: [ + BoxShadow( + color: Colors.black.withOpacity(0.25), + blurRadius: 4, + spreadRadius: 2, + offset: const Offset(0, 4), + ), + ], + backgroundGradient: const LinearGradient( + colors: [AppColor.greenColor, AppColor.accentColor], + begin: Alignment.topLeft, + end: Alignment.bottomRight, + ), + onTap: (GetSnackBar snackBar) { + // Do something when the snackbar is tapped. + // MapController().rideConfirm = false; + // update(); + }, + isDismissible: true, + showProgressIndicator: false, + dismissDirection: DismissDirection.up, + progressIndicatorController: null, + progressIndicatorBackgroundColor: Colors.transparent, + progressIndicatorValueColor: null, + snackStyle: SnackStyle.GROUNDED, + forwardAnimationCurve: Curves.easeInToLinear, + reverseAnimationCurve: Curves.easeInOut, + animationDuration: const Duration(milliseconds: 4000), + barBlur: 8, + overlayBlur: 0, + snackbarStatus: null, + overlayColor: AppColor.primaryColor.withOpacity(0.5), + userInputForm: null, + ); + } else if (message.notification!.title!.contains('Promo')) { + Get.to(const PromosPassengerPage()); } }); } diff --git a/lib/controller/functions/crud.dart b/lib/controller/functions/crud.dart index e95f11f..7bf73f2 100644 --- a/lib/controller/functions/crud.dart +++ b/lib/controller/functions/crud.dart @@ -26,7 +26,7 @@ class CRUD { if (response.statusCode == 200) { var jsonData = jsonDecode(response.body); if (jsonData['status'] == 'success') { - // print(jsonData); + print(jsonData); return response.body; } return jsonData['status']; diff --git a/lib/controller/home/map_page_controller.dart b/lib/controller/home/map_page_controller.dart index d6cac87..a013d11 100644 --- a/lib/controller/home/map_page_controller.dart +++ b/lib/controller/home/map_page_controller.dart @@ -30,6 +30,7 @@ class MapController extends GetxController { LatLng mydestination = const LatLng(32.115295, 36.064773); final List polylineCoordinates = []; List carsLocationByPassenger = []; + List driverCarsLocationToPassengerAfterApplied = []; BitmapDescriptor markerIcon = BitmapDescriptor.defaultMarker; BitmapDescriptor carIcon = BitmapDescriptor.defaultMarker; double height = 150; @@ -57,6 +58,7 @@ class MapController extends GetxController { late LatLng northeast; List carLocations = []; var dataCarsLocationByPassenger; + var datadriverCarsLocationToPassengerAfterApplied; CarLocation? nearestCar; late Timer markerReloadingTimer; bool shouldFetch = true; // Flag to determine if fetch should be executed @@ -226,7 +228,7 @@ class MapController extends GetxController { void timerEnded() async { print('Timer ended'); - // refuseOrder(); + runEvery50SecondsUntilConditionMet(); isCancelRidePageShown = false; update(); } @@ -437,6 +439,59 @@ class MapController extends GetxController { } } + Future getDriverCarsLocationToPassengerAfterApplied() async { + driverCarsLocationToPassengerAfterApplied = []; + + var res = await CRUD().get( + link: AppLink.getDriverCarsLocationToPassengerAfterApplied, + payload: { + 'driver_id': dataCarsLocationByPassenger['message'][0]['driver_id'] + }); + + datadriverCarsLocationToPassengerAfterApplied = jsonDecode(res); + + driverCarsLocationToPassengerAfterApplied.add(LatLng( + double.parse(datadriverCarsLocationToPassengerAfterApplied['message'][0] + ['latitude']), + double.parse(datadriverCarsLocationToPassengerAfterApplied['message'][0] + ['longitude']))); + + update(); + } + + Future runEvery50SecondsUntilConditionMet() async { + // Calculate the duration of the trip in minutes. + double tripDurationInMinutes = duration1 / 60; + int loopCount = tripDurationInMinutes.ceil(); + // If the trip duration is less than or equal to 50 minutes, then break the loop. + for (var i = 0; i < loopCount; i++) { + // Wait for 50 seconds. + await Future.delayed(const Duration( + seconds: + 50)); // Run the `getDriverCarsLocationToPassengerAfterApplied()` function. + await getDriverCarsLocationToPassengerAfterApplied(); + reloadMarkerDriverCarsLocationToPassengerAfterApplied(); + } + } + + void reloadMarkerDriverCarsLocationToPassengerAfterApplied() { + // Clear existing markers + markers.clear(); + + for (var item in driverCarsLocationToPassengerAfterApplied) { + final marker = Marker( + infoWindow: InfoWindow(title: '${item.latitude} minutes'), + markerId: MarkerId(item.toString()), + position: LatLng(item.latitude, item.longitude), + ); + markers.add(marker); + update(); + mapController?.animateCamera( + CameraUpdate.newLatLng(LatLng(item.latitude, item.longitude))); + update(); + } // Update the map with the new markers + } + LatLngBounds calculateBounds( double centerLat, double centerLng, double radius) { // double radius = 4000; // 10 km in meters diff --git a/lib/controller/payment/payment_controller.dart b/lib/controller/payment/payment_controller.dart index cb5bcd2..d408d06 100644 --- a/lib/controller/payment/payment_controller.dart +++ b/lib/controller/payment/payment_controller.dart @@ -18,7 +18,7 @@ class PaymentController extends GetxController { final formKey = GlobalKey(); final promo = TextEditingController(); double totalPassenger = MapController().totalPassenger; - int? selectedAmount; + int? selectedAmount = 0; List totalPassengerWalletDetails = []; String passengerTotalWalletAmount = ''; void updateSelectedAmount(int value) { diff --git a/lib/main.dart b/lib/main.dart index 189e731..2ab120d 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -5,6 +5,7 @@ import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:get_storage/get_storage.dart'; +import 'package:ride/constant/info.dart'; import 'package:ride/views/auth/captin/login_captin.dart'; import 'package:ride/views/auth/login_page.dart'; import 'package:ride/views/home/Captin/home_captin.dart'; @@ -42,7 +43,7 @@ void main() async { await FirebasMessagesController().requestFirebaseMessagingPermission(); // await FirebasMessagesController().getNotificationSettings(); await FirebasMessagesController().getToken(); - await FirebasMessagesController().getTokens(); + // await FirebasMessagesController().getTokens(); LocationPermissions().locationPermissions(); FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler); // if (box.read(BoxName.driverID) != null) { @@ -61,7 +62,7 @@ class MyApp extends StatelessWidget { LocaleController controller = Get.put(LocaleController()); return GetMaterialApp( - title: 'Sefer', + title: AppInfo.appName, translations: MyTranslation(), debugShowCheckedModeBanner: false, locale: controller.language, diff --git a/lib/views/home/map_page.dart b/lib/views/home/map_page.dart index 6680dc0..38838e4 100644 --- a/lib/views/home/map_page.dart +++ b/lib/views/home/map_page.dart @@ -15,6 +15,7 @@ import '../../controller/home/menu_controller.dart'; import 'map_widget.dart/buttom_sheet_map_show.dart'; import 'map_widget.dart/cash_confirm_bottom_page.dart'; import 'map_widget.dart/driver_card_from_passenger.dart'; +import 'map_widget.dart/driver_time_arrive_passenger.dart'; import 'map_widget.dart/left_main_menu_icons.dart'; import 'map_widget.dart/main_bottom_Menu_map.dart'; import 'map_widget.dart/map_menu_widget.dart'; @@ -285,6 +286,7 @@ class MapPage extends StatelessWidget { const CashConfirmPageShown(), const PaymentMethodPage(), timerForCancellTripFromPassenger(), + const DriverTimeArrivePassenger(), ], ), ), diff --git a/lib/views/home/map_widget.dart/driver_card_from_passenger.dart b/lib/views/home/map_widget.dart/driver_card_from_passenger.dart index c94e6cf..72abbda 100644 --- a/lib/views/home/map_widget.dart/driver_card_from_passenger.dart +++ b/lib/views/home/map_widget.dart/driver_card_from_passenger.dart @@ -20,35 +20,15 @@ GetBuilder hexagonClipper() { duration: const Duration(microseconds: 300), height: 250, width: 250, - decoration: BoxDecoration( - boxShadow: [ - BoxShadow( - color: AppColor.primaryColor.withOpacity(0.25), - blurRadius: 4, - spreadRadius: 2, - offset: const Offset(0, 4), - ), - BoxShadow( - color: AppColor.accentColor.withOpacity(0.5), - offset: const Offset(-5, -5), - blurRadius: 5, - spreadRadius: 2, - ), - BoxShadow( - color: AppColor.secondaryColor.withOpacity(0.2), - offset: const Offset(5, 5), - blurRadius: 5, - spreadRadius: 2, - ), - ], - gradient: const LinearGradient( - colors: [AppColor.greenColor, AppColor.secondaryColor], - begin: Alignment.topLeft, - end: Alignment.bottomCenter, - ), - border: Border.all(), - color: AppColor.secondaryColor, - borderRadius: BorderRadius.circular(15)), + decoration: AppStyle.boxDecoration(), + // gradient: const LinearGradient( + // colors: [AppColor.greenColor, AppColor.secondaryColor], + // begin: Alignment.topLeft, + // end: Alignment.bottomCenter, + // ), + // border: Border.all(), + // color: AppColor.secondaryColor, + // borderRadius: BorderRadius.circular(15)), child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, diff --git a/lib/views/home/map_widget.dart/driver_time_arrive_passenger.dart b/lib/views/home/map_widget.dart/driver_time_arrive_passenger.dart new file mode 100644 index 0000000..fc0eec8 --- /dev/null +++ b/lib/views/home/map_widget.dart/driver_time_arrive_passenger.dart @@ -0,0 +1,44 @@ +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:ride/views/home/map_widget.dart/hexegone_clipper.dart'; + +import '../../../constant/style.dart'; +import '../../../controller/home/map_page_controller.dart'; + +class DriverTimeArrivePassenger extends StatelessWidget { + const DriverTimeArrivePassenger({super.key}); + + @override + Widget build(BuildContext context) { + return GetBuilder( + builder: (controller) { + return controller.remainingTime == 0 + ? Positioned.directional( + bottom: Get.height * .35, + end: Get.width * .05, + textDirection: Get.locale!.languageCode == 'ar' + ? TextDirection.rtl + : TextDirection.ltr, + child: Stack( + alignment: Alignment.center, + children: [ + Container( + decoration: AppStyle.boxDecoration(), + // width: 50, + // height: 50, + child: Padding( + padding: const EdgeInsetsDirectional.only( + start: 5, end: 5), + child: Text( + controller.duratioByPassenger.toString(), + style: AppStyle.title, + ), + )) + ], + ), + ) + : const SizedBox(); + }, + ); + } +} diff --git a/lib/views/home/map_widget.dart/hexegone_clipper.dart b/lib/views/home/map_widget.dart/hexegone_clipper.dart index 761981b..8cd0555 100644 --- a/lib/views/home/map_widget.dart/hexegone_clipper.dart +++ b/lib/views/home/map_widget.dart/hexegone_clipper.dart @@ -34,3 +34,19 @@ class HexagonClipper extends CustomClipper { @override bool shouldReclip(HexagonClipper oldClipper) => false; } + +class ArrowClipper extends CustomClipper { + @override + Path getClip(Size size) { + final path = Path(); + path.moveTo(0, size.height / 2); + path.lineTo(size.width / 2, 0); + path.lineTo(size.width, size.height / 2); + path.lineTo(size.width / 2, size.height); + path.close(); + return path; + } + + @override + bool shouldReclip(ArrowClipper oldClipper) => false; +} diff --git a/lib/views/home/map_widget.dart/map_menu_widget.dart b/lib/views/home/map_widget.dart/map_menu_widget.dart index 462b339..0a22bfa 100644 --- a/lib/views/home/map_widget.dart/map_menu_widget.dart +++ b/lib/views/home/map_widget.dart/map_menu_widget.dart @@ -32,23 +32,7 @@ class MapMenuWidget extends StatelessWidget { opacity: 1, // Adjust the opacity value as needed child: AnimatedContainer( width: Get.width * .6, - decoration: const BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(12)), - color: AppColor.secondaryColor, - boxShadow: [ - BoxShadow( - color: AppColor.accentColor, - offset: Offset(-3, -3), - blurRadius: 0, - spreadRadius: 0, - blurStyle: BlurStyle.outer), - BoxShadow( - color: AppColor.accentColor, - offset: Offset(3, 3), - blurRadius: 0, - spreadRadius: 0, - blurStyle: BlurStyle.outer) - ]), + decoration: AppStyle.boxDecoration(), transform: Matrix4.translationValues( controller.heightMenu * .1, 1, 1), curve: Curves.easeOutCubic, diff --git a/lib/views/home/map_widget.dart/timer_for_cancell_trip_from_passenger.dart b/lib/views/home/map_widget.dart/timer_for_cancell_trip_from_passenger.dart index 94a179b..ae2b603 100644 --- a/lib/views/home/map_widget.dart/timer_for_cancell_trip_from_passenger.dart +++ b/lib/views/home/map_widget.dart/timer_for_cancell_trip_from_passenger.dart @@ -10,9 +10,9 @@ GetBuilder timerForCancellTripFromPassenger() { final isNearEnd = controller.remainingTime <= 5; // Define a threshold for "near end" - return controller.shouldFetch == false + return controller.remainingTime > 0 && controller.remainingTime != 25 ? Positioned( - bottom: Get.height * .3, + bottom: Get.height * .35, left: Get.width * .05, child: Stack( alignment: Alignment.center, diff --git a/lib/views/home/my_wallet/passenger_wallet.dart b/lib/views/home/my_wallet/passenger_wallet.dart index 8e73fe2..87160fb 100644 --- a/lib/views/home/my_wallet/passenger_wallet.dart +++ b/lib/views/home/my_wallet/passenger_wallet.dart @@ -4,11 +4,13 @@ import 'package:get/get.dart'; import 'package:ride/constant/links.dart'; import 'package:ride/constant/style.dart'; import 'package:ride/controller/functions/crud.dart'; +import 'package:ride/controller/functions/toast.dart'; import 'package:ride/controller/payment/payment_controller.dart'; import 'package:ride/views/widgets/my_scafold.dart'; import 'package:flutter_paypal/flutter_paypal.dart'; import '../../../constant/box_name.dart'; import '../../../constant/colors.dart'; +import '../../../constant/info.dart'; import '../../../controller/functions/secure_storage.dart'; import '../../../controller/home/payment/credit_card_Controller.dart'; import '../../../main.dart'; @@ -57,10 +59,17 @@ class PassengerWallet extends StatelessWidget { ]), child: Padding( padding: const EdgeInsets.all(10), - child: Text( - 'You Have ${box.read(BoxName.passengerWalletTotal).toString()} JD in SEFER Wallet', - style: AppStyle.title, - ), + child: + box.read(BoxName.passengerWalletTotal) == null + ? Text( + 'You Dont Have Any amount in ${AppInfo.appName} Wallet!' + .tr, + style: AppStyle.title, + ) + : Text( + 'You Have ${box.read(BoxName.passengerWalletTotal).toString()} JD in ${AppInfo.appName} Wallet', + style: AppStyle.title, + ), ), ), ], @@ -306,94 +315,112 @@ class PassengerWallet extends StatelessWidget { MyElevatedButton( title: 'Pay with Your PayPal', onPressed: () { - Navigator.of(context).push( - MaterialPageRoute( - builder: (BuildContext context) => - UsePaypal( - sandboxMode: true, - clientId: - "AW1TdvpSGbIM5iP4HJNI5TyTmwpY9Gv9dYw8_8yW5lYIbCqf326vrkrp0ce9TAqjEGMHiV3OqJM_aRT0", - secretKey: - "EHHtTDjnmTZATYBPiGzZC_AZUfMpMAzj2VZUeqlFUrRJA_C0pQNCxDccB5qoRQSEdcOnnKQhycuOWdP9", - returnURL: - "https://samplesite.com/return", - cancelURL: - "https://samplesite.com/cancel", - transactions: [ - { - "amount": { - //sb-opsju26682403@personal.example.com - "total": - '${controller.selectedAmount}', - "currency": "USD", - "details": { - "subtotal": + if (controller.selectedAmount != 0) { + print(controller.selectedAmount); + controller.changePromoSheetDialogue(); + Navigator.of(context).push( + MaterialPageRoute( + builder: (BuildContext context) => + UsePaypal( + sandboxMode: true, + clientId: + "AW1TdvpSGbIM5iP4HJNI5TyTmwpY9Gv9dYw8_8yW5lYIbCqf326vrkrp0ce9TAqjEGMHiV3OqJM_aRT0", + secretKey: + "EHHtTDjnmTZATYBPiGzZC_AZUfMpMAzj2VZUeqlFUrRJA_C0pQNCxDccB5qoRQSEdcOnnKQhycuOWdP9", + returnURL: + "https://samplesite.com/return", + cancelURL: + "https://samplesite.com/cancel", + transactions: [ + { + "amount": { + //sb-opsju26682403@personal.example.com + "total": '${controller.selectedAmount}', - "shipping": '0', - "shipping_discount": 0 - } - }, - "description": - "The payment transaction description.", - "payment_options": const { - "allowed_payment_method": - "INSTANT_FUNDING_SOURCE" - }, - "item_list": { - "items": [ - { - "name": "Sefer Wallet ", - "quantity": 1, - "price": + "currency": "USD", + "details": { + "subtotal": '${controller.selectedAmount}', - "currency": "USD" + "shipping": '0', + "shipping_discount": 0 } - ], - - // shipping address is not required though - "shipping_address": const { - "recipient_name": - "SEFER Wallet", - "line1": "Shafa Badran", - "line2": "", - "city": "Amman", - "country_code": "JO", - "postal_code": "13112", - "phone": "+962798583052", - "state": "Amman" }, + "description": + "The payment transaction description.", + "payment_options": const { + "allowed_payment_method": + "INSTANT_FUNDING_SOURCE" + }, + "item_list": { + "items": [ + { + "name": + "${AppInfo.appName} Wallet ", + "quantity": 1, + "price": + '${controller.selectedAmount}', + "currency": "USD" + } + ], + + // shipping address is not required though + "shipping_address": const { + "recipient_name": + "${AppInfo.appName} Wallet", + "line1": "Shafa Badran", + "line2": "", + "city": "Amman", + "country_code": "JO", + "postal_code": "13112", + "phone": "+962798583052", + "state": "Amman" + }, + } } - } - ], - note: - "Contact us for any questions on your order.", - onSuccess: (Map params) async { - print("onSuccess: $params"); - await CRUD().post( - link: AppLink - .addPassengersWallet, - payload: { - 'passenger_id': box - .read( - BoxName.pasengerID) - .toString(), - 'balance': controller - .selectedAmount - .toString() - }); - controller - .changePromoSheetDialogue(); - await controller - .getPassengerWallet(); - }, - onError: (error) { - print("onError: $error"); - }, - onCancel: (params) { - print('cancelled: $params'); - }), - ), - ); + ], + note: + "Contact us for any questions on your order.", + onSuccess: (Map params) async { + print("onSuccess: $params"); + await CRUD().post( + link: AppLink + .addPassengersWallet, + payload: { + 'passenger_id': box + .read(BoxName + .pasengerID) + .toString(), + 'balance': controller + .selectedAmount + .toString() + }); + controller + .changePromoSheetDialogue(); + await controller + .getPassengerWallet(); + }, + onError: (error) { + print("onError: $error"); + Toast.show( + context, + ' $error'.tr, + AppColor.redColor); + }, + onCancel: (params) { + print('cancelled: $params'); + Toast.show( + context, + 'Pyament Cancelled .'.tr, + AppColor.yellowColor); + }), + ), + ); + } else { + Toast.show( + context, + 'You will choose one of above !'.tr, + AppColor.redColor); + } // controller.changePromoSheetDialogue(); // Get.to(() { // UsePaypal( diff --git a/lib/views/orderCaptin/order_request_page.dart b/lib/views/orderCaptin/order_request_page.dart index 6690c0e..69daed7 100644 --- a/lib/views/orderCaptin/order_request_page.dart +++ b/lib/views/orderCaptin/order_request_page.dart @@ -197,8 +197,21 @@ class OrderRequestPage extends StatelessWidget { MyElevatedButton( title: 'Refuse Order'.tr, onPressed: () async { + List bodyToPassenger = [ + box.read(BoxName.driverID).toString(), + box.read(BoxName.nameDriver).toString(), + box.read(BoxName.tokenDriver).toString(), + ]; timerController.refuseOrder( myList[6].toString(), body.toString()); + FirebasMessagesController() + .sendNotificanToPassengerToken( + 'Refused Ride', + arguments['DriverList'][9].toString(), + arguments['DriverList'][9].toString(), + // box.read(BoxName.tokenDriver).toString(), + bodyToPassenger, + ); }, kolor: AppColor.redColor, ),