25-1/28/1
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:sefer_driver/constant/box_name.dart';
|
||||
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';
|
||||
@@ -15,7 +14,6 @@ import 'package:get/get.dart';
|
||||
import 'package:share/share.dart';
|
||||
|
||||
import '../../../main.dart';
|
||||
import '../../../print.dart';
|
||||
import '../../../views/widgets/error_snakbar.dart';
|
||||
import '../../functions/launch.dart';
|
||||
import '../../notification/notification_captain_controller.dart';
|
||||
@@ -41,9 +39,9 @@ class InviteController extends GetxController {
|
||||
Future<void> shareDriverCode() async {
|
||||
if (driverCouponCode != null) {
|
||||
final String shareText = '''
|
||||
Join SEFER as a driver using my referral code!
|
||||
Join SPEED as a driver using my referral code!
|
||||
Use code: $driverCouponCode
|
||||
Download the SEFER Driver app now and earn rewards!
|
||||
Download the SPEED Driver app now and earn rewards!
|
||||
''';
|
||||
await Share.share(shareText);
|
||||
}
|
||||
@@ -52,9 +50,9 @@ Download the SEFER Driver app now and earn rewards!
|
||||
Future<void> sharePassengerCode() async {
|
||||
if (couponCode != null) {
|
||||
final String shareText = '''
|
||||
Get a discount on your first SEFER ride!
|
||||
Get a discount on your first SPEED ride!
|
||||
Use my referral code: $couponCode
|
||||
Download the SEFER app now and enjoy your ride!
|
||||
Download the SPEED app now and enjoy your ride!
|
||||
''';
|
||||
await Share.share(shareText);
|
||||
}
|
||||
@@ -150,23 +148,17 @@ Download the SEFER app now and enjoy your ride!
|
||||
|
||||
void onSelectDriverInvitation(int index) async {
|
||||
MyDialog().getDialog(
|
||||
int.parse(encryptionHelper.decryptData(
|
||||
driverInvitationData[index]['countOfInvitDriver'])) <
|
||||
100
|
||||
int.parse((driverInvitationData[index]['countOfInvitDriver'])) < 100
|
||||
? '${'When'.tr} ${encryptionHelper.decryptData(driverInvitationData[index]['invitorName'])} ${"complete, you can claim your gift".tr} '
|
||||
: 'You deserve the gift'.tr,
|
||||
'${encryptionHelper.decryptData(driverInvitationData[index]['invitorName'])} ${encryptionHelper.decryptData(driverInvitationData[index]['countOfInvitDriver'])} / 100 ${'Trip'.tr}',
|
||||
'${encryptionHelper.decryptData(driverInvitationData[index]['invitorName'])} ${(driverInvitationData[index]['countOfInvitDriver'])} / 100 ${'Trip'.tr}',
|
||||
() async {
|
||||
if (int.parse(encryptionHelper.decryptData(
|
||||
driverInvitationData[index]['countOfInvitDriver'])) <
|
||||
if (int.parse((driverInvitationData[index]['countOfInvitDriver'])) <
|
||||
100) {
|
||||
Get.back();
|
||||
} else {
|
||||
//claim your gift
|
||||
if (encryptionHelper
|
||||
.decryptData(driverInvitationData[index]['isGiftToken'])
|
||||
.toString() ==
|
||||
'0') {
|
||||
if ((driverInvitationData[index]['isGiftToken']).toString() == '0') {
|
||||
Get.back();
|
||||
await CRUD().post(link: AppLink.updateInviteDriver, payload: {
|
||||
'id': encryptionHelper
|
||||
@@ -210,12 +202,17 @@ Download the SEFER app now and enjoy your ride!
|
||||
|
||||
void onSelectPassengerInvitation(int index) async {
|
||||
MyDialog().getDialog(
|
||||
driverInvitationDataToPassengers[index]['countOfInvitDriver'] < 3
|
||||
? '${'When'.tr} ${driverInvitationDataToPassengers[index]['passengerName']} ${"complete, you can claim your gift".tr} '
|
||||
int.parse(driverInvitationDataToPassengers[index]['countOfInvitDriver']
|
||||
.toString()) <
|
||||
3
|
||||
? '${'When'.tr} ${encryptionHelper.decryptData(driverInvitationDataToPassengers[index]['passengerName'].toString())} ${"complete, you can claim your gift".tr} '
|
||||
: 'You deserve the gift'.tr,
|
||||
'${driverInvitationDataToPassengers[index]['passengerName']} ${driverInvitationDataToPassengers[index]['countOfInvitDriver']} / 6 ${'Trip'.tr}',
|
||||
'${encryptionHelper.decryptData(driverInvitationDataToPassengers[index]['passengerName'].toString())} ${driverInvitationDataToPassengers[index]['countOfInvitDriver']} / 3 ${'Trip'.tr}',
|
||||
() async {
|
||||
if (driverInvitationDataToPassengers[index]['countOfInvitDriver'] < 3) {
|
||||
if (int.parse(driverInvitationDataToPassengers[index]
|
||||
['countOfInvitDriver']
|
||||
.toString()) <
|
||||
3) {
|
||||
Get.back();
|
||||
} else {
|
||||
// Claim the gift if 100 trips are completed
|
||||
@@ -303,7 +300,7 @@ Download the SEFER app now and enjoy your ride!
|
||||
if (response != 'failure') {
|
||||
var d = jsonDecode(response);
|
||||
mySnackbarSuccess('Invite sent successfully'.tr);
|
||||
String message = '${'*SEFER DRIVER CODE*'.tr}\n\n'
|
||||
String message = '${'*SPEED DRIVER CODE*'.tr}\n\n'
|
||||
'${"Use this code in registration".tr}\n'
|
||||
'${"To get a gift for both".tr}\n\n'
|
||||
'${"The period of this code is 1 hour".tr}\n\n'
|
||||
@@ -342,7 +339,7 @@ Download the SEFER app now and enjoy your ride!
|
||||
|
||||
mySnackbarSuccess('Invite sent successfully'.tr);
|
||||
|
||||
String message = '${'*SEFER APP CODE*'.tr}\n\n'
|
||||
String message = '${'*SPEED APP CODE*'.tr}\n\n'
|
||||
'${"Use this code in registration".tr}\n'
|
||||
'${"To get a gift for both".tr}\n\n'
|
||||
'${"The period of this code is 1 hour".tr}\n\n'
|
||||
|
||||
Reference in New Issue
Block a user