This commit is contained in:
Hamza-Ayed
2023-09-17 18:42:51 +03:00
parent 2be93e8267
commit 5f402a0b65
17 changed files with 359 additions and 146 deletions

View File

@@ -4,6 +4,8 @@ class AppColor {
static const Color primaryColor = Colors.black; static const Color primaryColor = Colors.black;
static const Color secondaryColor = Colors.white; static const Color secondaryColor = Colors.white;
static const Color accentColor = Colors.grey; static const Color accentColor = Colors.grey;
static const Color redColor = Color.fromARGB(255, 199, 56, 46); static const Color redColor = Color(0xFFEA4335); // Google Red
static const Color greenColor = Color.fromARGB(255, 43, 225, 43); static const Color greenColor = Color(0xFF34A853); // Google Green
static const Color blueColor = Color(0xFF4285F4); // Google Blue
static const Color yellowColor = Color(0xFFFBBC05); // Google Yellow
} }

View File

@@ -1,5 +1,6 @@
class Fleek { class AppInfo {
static const String companyName = 'Fleek-tech'; static const String companyName = 'Mobile-App';
static const String appName = 'SEFER';
static const String phoneNumber = '962798583052'; static const String phoneNumber = '962798583052';
static const String linkedInProfile = static const String linkedInProfile =
'https://www.linkedin.com/in/hamza-ayed/'; 'https://www.linkedin.com/in/hamza-ayed/';

View File

@@ -51,6 +51,8 @@ class AppLink {
//==================certifcate========== //==================certifcate==========
static const String location = '$server/ride/location'; static const String location = '$server/ride/location';
static const String getCarsLocationByPassenger = "$location/get.php"; static const String getCarsLocationByPassenger = "$location/get.php";
static const String getDriverCarsLocationToPassengerAfterApplied =
"$location/getDriverCarsLocationToPassengerAfterApplied.php";
static const String addCarsLocationByPassenger = "$location/add.php"; static const String addCarsLocationByPassenger = "$location/add.php";
static const String deleteCarsLocationByPassenger = "$location/delete.php"; static const String deleteCarsLocationByPassenger = "$location/delete.php";
static const String updateCarsLocationByPassenger = "$location/update.php"; static const String updateCarsLocationByPassenger = "$location/update.php";

View File

@@ -28,4 +28,24 @@ class AppStyle {
fontSize: 20, fontSize: 20,
color: AppColor.primaryColor, color: AppColor.primaryColor,
fontFamily: GoogleFonts.josefinSans().fontFamily); 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)
]);
}
} }

View File

@@ -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<dynamic>;
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());
} }
}); });
} }

View File

@@ -26,7 +26,7 @@ class CRUD {
if (response.statusCode == 200) { if (response.statusCode == 200) {
var jsonData = jsonDecode(response.body); var jsonData = jsonDecode(response.body);
if (jsonData['status'] == 'success') { if (jsonData['status'] == 'success') {
// print(jsonData); print(jsonData);
return response.body; return response.body;
} }
return jsonData['status']; return jsonData['status'];

View File

@@ -30,6 +30,7 @@ class MapController extends GetxController {
LatLng mydestination = const LatLng(32.115295, 36.064773); LatLng mydestination = const LatLng(32.115295, 36.064773);
final List<LatLng> polylineCoordinates = []; final List<LatLng> polylineCoordinates = [];
List<LatLng> carsLocationByPassenger = []; List<LatLng> carsLocationByPassenger = [];
List<LatLng> driverCarsLocationToPassengerAfterApplied = [];
BitmapDescriptor markerIcon = BitmapDescriptor.defaultMarker; BitmapDescriptor markerIcon = BitmapDescriptor.defaultMarker;
BitmapDescriptor carIcon = BitmapDescriptor.defaultMarker; BitmapDescriptor carIcon = BitmapDescriptor.defaultMarker;
double height = 150; double height = 150;
@@ -57,6 +58,7 @@ class MapController extends GetxController {
late LatLng northeast; late LatLng northeast;
List<CarLocationModel> carLocations = <CarLocationModel>[]; List<CarLocationModel> carLocations = <CarLocationModel>[];
var dataCarsLocationByPassenger; var dataCarsLocationByPassenger;
var datadriverCarsLocationToPassengerAfterApplied;
CarLocation? nearestCar; CarLocation? nearestCar;
late Timer markerReloadingTimer; late Timer markerReloadingTimer;
bool shouldFetch = true; // Flag to determine if fetch should be executed bool shouldFetch = true; // Flag to determine if fetch should be executed
@@ -226,7 +228,7 @@ class MapController extends GetxController {
void timerEnded() async { void timerEnded() async {
print('Timer ended'); print('Timer ended');
// refuseOrder(); runEvery50SecondsUntilConditionMet();
isCancelRidePageShown = false; isCancelRidePageShown = false;
update(); 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( LatLngBounds calculateBounds(
double centerLat, double centerLng, double radius) { double centerLat, double centerLng, double radius) {
// double radius = 4000; // 10 km in meters // double radius = 4000; // 10 km in meters

View File

@@ -18,7 +18,7 @@ class PaymentController extends GetxController {
final formKey = GlobalKey<FormState>(); final formKey = GlobalKey<FormState>();
final promo = TextEditingController(); final promo = TextEditingController();
double totalPassenger = MapController().totalPassenger; double totalPassenger = MapController().totalPassenger;
int? selectedAmount; int? selectedAmount = 0;
List<dynamic> totalPassengerWalletDetails = []; List<dynamic> totalPassengerWalletDetails = [];
String passengerTotalWalletAmount = ''; String passengerTotalWalletAmount = '';
void updateSelectedAmount(int value) { void updateSelectedAmount(int value) {

View File

@@ -5,6 +5,7 @@ import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:get_storage/get_storage.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/captin/login_captin.dart';
import 'package:ride/views/auth/login_page.dart'; import 'package:ride/views/auth/login_page.dart';
import 'package:ride/views/home/Captin/home_captin.dart'; import 'package:ride/views/home/Captin/home_captin.dart';
@@ -42,7 +43,7 @@ void main() async {
await FirebasMessagesController().requestFirebaseMessagingPermission(); await FirebasMessagesController().requestFirebaseMessagingPermission();
// await FirebasMessagesController().getNotificationSettings(); // await FirebasMessagesController().getNotificationSettings();
await FirebasMessagesController().getToken(); await FirebasMessagesController().getToken();
await FirebasMessagesController().getTokens(); // await FirebasMessagesController().getTokens();
LocationPermissions().locationPermissions(); LocationPermissions().locationPermissions();
FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler); FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler);
// if (box.read(BoxName.driverID) != null) { // if (box.read(BoxName.driverID) != null) {
@@ -61,7 +62,7 @@ class MyApp extends StatelessWidget {
LocaleController controller = Get.put(LocaleController()); LocaleController controller = Get.put(LocaleController());
return GetMaterialApp( return GetMaterialApp(
title: 'Sefer', title: AppInfo.appName,
translations: MyTranslation(), translations: MyTranslation(),
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
locale: controller.language, locale: controller.language,

View File

@@ -15,6 +15,7 @@ import '../../controller/home/menu_controller.dart';
import 'map_widget.dart/buttom_sheet_map_show.dart'; import 'map_widget.dart/buttom_sheet_map_show.dart';
import 'map_widget.dart/cash_confirm_bottom_page.dart'; import 'map_widget.dart/cash_confirm_bottom_page.dart';
import 'map_widget.dart/driver_card_from_passenger.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/left_main_menu_icons.dart';
import 'map_widget.dart/main_bottom_Menu_map.dart'; import 'map_widget.dart/main_bottom_Menu_map.dart';
import 'map_widget.dart/map_menu_widget.dart'; import 'map_widget.dart/map_menu_widget.dart';
@@ -285,6 +286,7 @@ class MapPage extends StatelessWidget {
const CashConfirmPageShown(), const CashConfirmPageShown(),
const PaymentMethodPage(), const PaymentMethodPage(),
timerForCancellTripFromPassenger(), timerForCancellTripFromPassenger(),
const DriverTimeArrivePassenger(),
], ],
), ),
), ),

View File

@@ -20,35 +20,15 @@ GetBuilder<MapController> hexagonClipper() {
duration: const Duration(microseconds: 300), duration: const Duration(microseconds: 300),
height: 250, height: 250,
width: 250, width: 250,
decoration: BoxDecoration( decoration: AppStyle.boxDecoration(),
boxShadow: [ // gradient: const LinearGradient(
BoxShadow( // colors: [AppColor.greenColor, AppColor.secondaryColor],
color: AppColor.primaryColor.withOpacity(0.25), // begin: Alignment.topLeft,
blurRadius: 4, // end: Alignment.bottomCenter,
spreadRadius: 2, // ),
offset: const Offset(0, 4), // border: Border.all(),
), // color: AppColor.secondaryColor,
BoxShadow( // borderRadius: BorderRadius.circular(15)),
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)),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,

View File

@@ -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<MapController>(
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();
},
);
}
}

View File

@@ -34,3 +34,19 @@ class HexagonClipper extends CustomClipper<Path> {
@override @override
bool shouldReclip(HexagonClipper oldClipper) => false; bool shouldReclip(HexagonClipper oldClipper) => false;
} }
class ArrowClipper extends CustomClipper<Path> {
@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;
}

View File

@@ -32,23 +32,7 @@ class MapMenuWidget extends StatelessWidget {
opacity: 1, // Adjust the opacity value as needed opacity: 1, // Adjust the opacity value as needed
child: AnimatedContainer( child: AnimatedContainer(
width: Get.width * .6, width: Get.width * .6,
decoration: const BoxDecoration( decoration: AppStyle.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)
]),
transform: Matrix4.translationValues( transform: Matrix4.translationValues(
controller.heightMenu * .1, 1, 1), controller.heightMenu * .1, 1, 1),
curve: Curves.easeOutCubic, curve: Curves.easeOutCubic,

View File

@@ -10,9 +10,9 @@ GetBuilder<MapController> timerForCancellTripFromPassenger() {
final isNearEnd = final isNearEnd =
controller.remainingTime <= 5; // Define a threshold for "near end" controller.remainingTime <= 5; // Define a threshold for "near end"
return controller.shouldFetch == false return controller.remainingTime > 0 && controller.remainingTime != 25
? Positioned( ? Positioned(
bottom: Get.height * .3, bottom: Get.height * .35,
left: Get.width * .05, left: Get.width * .05,
child: Stack( child: Stack(
alignment: Alignment.center, alignment: Alignment.center,

View File

@@ -4,11 +4,13 @@ import 'package:get/get.dart';
import 'package:ride/constant/links.dart'; import 'package:ride/constant/links.dart';
import 'package:ride/constant/style.dart'; import 'package:ride/constant/style.dart';
import 'package:ride/controller/functions/crud.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/controller/payment/payment_controller.dart';
import 'package:ride/views/widgets/my_scafold.dart'; import 'package:ride/views/widgets/my_scafold.dart';
import 'package:flutter_paypal/flutter_paypal.dart'; import 'package:flutter_paypal/flutter_paypal.dart';
import '../../../constant/box_name.dart'; import '../../../constant/box_name.dart';
import '../../../constant/colors.dart'; import '../../../constant/colors.dart';
import '../../../constant/info.dart';
import '../../../controller/functions/secure_storage.dart'; import '../../../controller/functions/secure_storage.dart';
import '../../../controller/home/payment/credit_card_Controller.dart'; import '../../../controller/home/payment/credit_card_Controller.dart';
import '../../../main.dart'; import '../../../main.dart';
@@ -57,10 +59,17 @@ class PassengerWallet extends StatelessWidget {
]), ]),
child: Padding( child: Padding(
padding: const EdgeInsets.all(10), padding: const EdgeInsets.all(10),
child: Text( child:
'You Have ${box.read(BoxName.passengerWalletTotal).toString()} JD in SEFER Wallet', box.read(BoxName.passengerWalletTotal) == null
style: AppStyle.title, ? 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( MyElevatedButton(
title: 'Pay with Your PayPal', title: 'Pay with Your PayPal',
onPressed: () { onPressed: () {
Navigator.of(context).push( if (controller.selectedAmount != 0) {
MaterialPageRoute( print(controller.selectedAmount);
builder: (BuildContext context) => controller.changePromoSheetDialogue();
UsePaypal( Navigator.of(context).push(
sandboxMode: true, MaterialPageRoute(
clientId: builder: (BuildContext context) =>
"AW1TdvpSGbIM5iP4HJNI5TyTmwpY9Gv9dYw8_8yW5lYIbCqf326vrkrp0ce9TAqjEGMHiV3OqJM_aRT0", UsePaypal(
secretKey: sandboxMode: true,
"EHHtTDjnmTZATYBPiGzZC_AZUfMpMAzj2VZUeqlFUrRJA_C0pQNCxDccB5qoRQSEdcOnnKQhycuOWdP9", clientId:
returnURL: "AW1TdvpSGbIM5iP4HJNI5TyTmwpY9Gv9dYw8_8yW5lYIbCqf326vrkrp0ce9TAqjEGMHiV3OqJM_aRT0",
"https://samplesite.com/return", secretKey:
cancelURL: "EHHtTDjnmTZATYBPiGzZC_AZUfMpMAzj2VZUeqlFUrRJA_C0pQNCxDccB5qoRQSEdcOnnKQhycuOWdP9",
"https://samplesite.com/cancel", returnURL:
transactions: [ "https://samplesite.com/return",
{ cancelURL:
"amount": { "https://samplesite.com/cancel",
//sb-opsju26682403@personal.example.com transactions: [
"total": {
'${controller.selectedAmount}', "amount": {
"currency": "USD", //sb-opsju26682403@personal.example.com
"details": { "total":
"subtotal":
'${controller.selectedAmount}', '${controller.selectedAmount}',
"shipping": '0', "currency": "USD",
"shipping_discount": 0 "details": {
} "subtotal":
},
"description":
"The payment transaction description.",
"payment_options": const {
"allowed_payment_method":
"INSTANT_FUNDING_SOURCE"
},
"item_list": {
"items": [
{
"name": "Sefer Wallet ",
"quantity": 1,
"price":
'${controller.selectedAmount}', '${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:
note: "Contact us for any questions on your order.",
"Contact us for any questions on your order.", onSuccess: (Map params) async {
onSuccess: (Map params) async { print("onSuccess: $params");
print("onSuccess: $params"); await CRUD().post(
await CRUD().post( link: AppLink
link: AppLink .addPassengersWallet,
.addPassengersWallet, payload: {
payload: { 'passenger_id': box
'passenger_id': box .read(BoxName
.read( .pasengerID)
BoxName.pasengerID) .toString(),
.toString(), 'balance': controller
'balance': controller .selectedAmount
.selectedAmount .toString()
.toString() });
}); controller
controller .changePromoSheetDialogue();
.changePromoSheetDialogue(); await controller
await controller .getPassengerWallet();
.getPassengerWallet(); },
}, onError: (error) {
onError: (error) { print("onError: $error");
print("onError: $error"); Toast.show(
}, context,
onCancel: (params) { ' $error'.tr,
print('cancelled: $params'); 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(); // controller.changePromoSheetDialogue();
// Get.to(() { // Get.to(() {
// UsePaypal( // UsePaypal(

View File

@@ -197,8 +197,21 @@ class OrderRequestPage extends StatelessWidget {
MyElevatedButton( MyElevatedButton(
title: 'Refuse Order'.tr, title: 'Refuse Order'.tr,
onPressed: () async { onPressed: () async {
List<String> bodyToPassenger = [
box.read(BoxName.driverID).toString(),
box.read(BoxName.nameDriver).toString(),
box.read(BoxName.tokenDriver).toString(),
];
timerController.refuseOrder( timerController.refuseOrder(
myList[6].toString(), body.toString()); 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, kolor: AppColor.redColor,
), ),