25-1/13/1-securejordan

This commit is contained in:
Hamza-Ayed
2025-01-13 22:10:47 +03:00
parent e8c3f8f339
commit a893e49282
36 changed files with 803 additions and 447 deletions

View File

@@ -5,6 +5,7 @@ import 'package:sefer_driver/constant/colors.dart';
import 'package:sefer_driver/constant/links.dart';
import 'package:sefer_driver/controller/firebase/local_notification.dart';
import 'package:sefer_driver/controller/functions/crud.dart';
import 'package:sefer_driver/controller/functions/encrypt_decrypt.dart';
import 'package:sefer_driver/controller/home/payment/captain_wallet_controller.dart';
import 'package:sefer_driver/views/widgets/mydialoug.dart';
import 'package:flutter/material.dart';
@@ -149,33 +150,42 @@ Download the SEFER app now and enjoy your ride!
void onSelectDriverInvitation(int index) async {
MyDialog().getDialog(
driverInvitationData[index]['countOfInvitDriver'] < 100
? '${'When'.tr} ${driverInvitationData[index]['invitorName']} ${"complete, you can claim your gift".tr} '
int.parse(encryptionHelper.decryptData(
driverInvitationData[index]['countOfInvitDriver'])) <
100
? '${'When'.tr} ${encryptionHelper.decryptData(driverInvitationData[index]['invitorName'])} ${"complete, you can claim your gift".tr} '
: 'You deserve the gift'.tr,
'${driverInvitationData[index]['invitorName']} ${driverInvitationData[index]['countOfInvitDriver']} / 100 ${'Trip'.tr}',
'${encryptionHelper.decryptData(driverInvitationData[index]['invitorName'])} ${encryptionHelper.decryptData(driverInvitationData[index]['countOfInvitDriver'])} / 100 ${'Trip'.tr}',
() async {
if (driverInvitationData[index]['countOfInvitDriver'] < 100) {
if (int.parse(encryptionHelper.decryptData(
driverInvitationData[index]['countOfInvitDriver'])) <
100) {
Get.back();
} else {
//claim your gift
if (driverInvitationData[index]['isGiftToken'].toString() == '0') {
if (encryptionHelper
.decryptData(driverInvitationData[index]['isGiftToken'])
.toString() ==
'0') {
Get.back();
await CRUD().post(
link: AppLink.updateInviteDriver,
payload: {'id': driverInvitationData[index]['id']});
await CRUD().post(link: AppLink.updateInviteDriver, payload: {
'id': encryptionHelper
.encryptData(driverInvitationData[index]['id'])
});
await Get.find<CaptainWalletController>().addDriverPayment(
'paymentMethod',
'500',
encryptionHelper.encryptData('500'),
'',
);
// add for invitor too
await Get.find<CaptainWalletController>().addDriverWalletToInvitor(
'paymentMethod',
driverInvitationData[index]['driverInviterId'],
'500',
encryptionHelper
.encryptData(driverInvitationData[index]['driverInviterId']),
encryptionHelper.encryptData('500'),
);
await Get.find<CaptainWalletController>()
.addSeferWallet('giftInvitation', '-1000');
await Get.find<CaptainWalletController>().addSeferWallet(
'giftInvitation', encryptionHelper.encryptData('-1000'));
NotificationCaptainController().addNotificationCaptain(
driverInvitationData[index]['driverInviterId'].toString(),
"You have got a gift for invitation".tr,