25-1/13/1-securejordan
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user