25-1/25/1-secure and links
This commit is contained in:
@@ -24,16 +24,16 @@ class ConnectWidget extends StatelessWidget {
|
||||
captainWalletController.getCaptainWalletFromBuyPoints();
|
||||
return Center(
|
||||
child: GetBuilder<HomeCaptainController>(
|
||||
builder: (homeCaptainController) => double.parse(encryptionHelper
|
||||
.decryptData(captainWalletController.totalPoints)) <
|
||||
builder: (homeCaptainController) => double.parse(
|
||||
(captainWalletController.totalPoints)) <
|
||||
-300
|
||||
? CupertinoButton(
|
||||
onPressed: () {
|
||||
Get.defaultDialog(
|
||||
// backgroundColor: CupertinoColors.destructiveRed,
|
||||
barrierDismissible: false,
|
||||
title: double.parse(encryptionHelper.decryptData(
|
||||
captainWalletController.totalPoints)) <
|
||||
title: double.parse(
|
||||
(captainWalletController.totalPoints)) <
|
||||
-300
|
||||
? 'You dont have Points'.tr
|
||||
: 'You Are Stopped For this Day !'.tr,
|
||||
@@ -42,9 +42,8 @@ class ConnectWidget extends StatelessWidget {
|
||||
children: [
|
||||
IconButton(
|
||||
onPressed: () async {
|
||||
double.parse(encryptionHelper.decryptData(
|
||||
captainWalletController
|
||||
.totalPoints)) <
|
||||
double.parse((captainWalletController
|
||||
.totalPoints)) <
|
||||
-300
|
||||
? await Get.find<TextToSpeechController>()
|
||||
.speakText(
|
||||
@@ -58,9 +57,8 @@ class ConnectWidget extends StatelessWidget {
|
||||
icon: const Icon(Icons.headphones),
|
||||
),
|
||||
Text(
|
||||
double.parse(encryptionHelper.decryptData(
|
||||
captainWalletController
|
||||
.totalPoints)) <
|
||||
double.parse((captainWalletController
|
||||
.totalPoints)) <
|
||||
-300
|
||||
? 'You must be recharge your Account'.tr
|
||||
: 'You Refused 3 Rides this Day that is the reason \nSee you Tomorrow!'
|
||||
@@ -69,8 +67,8 @@ class ConnectWidget extends StatelessWidget {
|
||||
),
|
||||
],
|
||||
),
|
||||
confirm: double.parse(encryptionHelper.decryptData(
|
||||
captainWalletController.totalPoints)) <
|
||||
confirm: double.parse(
|
||||
(captainWalletController.totalPoints)) <
|
||||
-300
|
||||
? MyElevatedButton(
|
||||
title: 'Recharge my Account'.tr,
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:sefer_driver/constant/box_name.dart';
|
||||
import 'package:sefer_driver/controller/firebase/local_notification.dart';
|
||||
import 'package:sefer_driver/controller/functions/crud.dart';
|
||||
import 'package:sefer_driver/main.dart';
|
||||
import 'package:sefer_driver/views/home/Captin/orderCaptin/vip_order_page.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -9,6 +12,7 @@ import 'package:sefer_driver/controller/home/captin/home_captain_controller.dart
|
||||
|
||||
import '../../../../../constant/colors.dart';
|
||||
import '../../../../../controller/functions/encrypt_decrypt.dart';
|
||||
import '../../../../../print.dart';
|
||||
import '../../../../Rate/ride_calculate_driver.dart';
|
||||
|
||||
GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
|
||||
@@ -101,19 +105,88 @@ GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
|
||||
child: Builder(builder: (context) {
|
||||
return IconButton(
|
||||
onPressed: () async {
|
||||
final plainText = 'Al-sayyd';
|
||||
debugPrint('Plain Text: $plainText');
|
||||
// final plainText =
|
||||
// 'https://server.sefer.live/sefer.click/sefer';
|
||||
// debugPrint('Plain Text: $plainText');
|
||||
|
||||
// Encrypt the data
|
||||
final encryptedData = encryptionHelper.encryptData(plainText);
|
||||
debugPrint('Encrypted: $encryptedData');
|
||||
// final encryptedData = encryptionHelper.encryptData(plainText);
|
||||
// debugPrint('Encrypted: $encryptedData');
|
||||
|
||||
// Decrypt the data
|
||||
final decryptedData = encryptionHelper.decryptData(
|
||||
encryptedData); // Use the encryptedData variable
|
||||
debugPrint('Decrypted: $decryptedData');
|
||||
// rlyouFVUqI7TEhu9UEMangaIViglSgxLk3/d1c0Yo7g=
|
||||
// rlyouFVUqI7TEhu9UEMangaIViglSgxLk3/d1c0Yo7g=
|
||||
// final decryptedData = encryptionHelper.decryptData(
|
||||
// encryptedData); // Use the encryptedData variable
|
||||
// debugPrint('Decrypted: $decryptedData');
|
||||
// box.remove('DriversSecure');
|
||||
var drivers0 = await CRUD().post(
|
||||
link:
|
||||
'https://server.sefer.live/sefer.click/sefer/auth/captin/getAllDriverSecure.php',
|
||||
payload: {});
|
||||
var decodedDriver;
|
||||
if (drivers0 != 'failure') {
|
||||
decodedDriver = jsonDecode(drivers0);
|
||||
|
||||
// box.write('DriversSecure', decodedDriver['message']);
|
||||
}
|
||||
var drivers = decodedDriver['message'];
|
||||
Log.print('drivers.length: ${drivers.length}');
|
||||
for (var i = 0; i < drivers.length; i++) {
|
||||
Log.print('drivers: ${drivers[i]['id']}');
|
||||
var payload = {
|
||||
"phone": encryptionHelper
|
||||
.encryptData(drivers[i]['phone'].toString()),
|
||||
"email": encryptionHelper
|
||||
.encryptData(drivers[i]['email'].toString()),
|
||||
"gender": encryptionHelper
|
||||
.encryptData(drivers[i]['gender'].toString()),
|
||||
"license_type": encryptionHelper
|
||||
.encryptData(drivers[i]['license_type'].toString()),
|
||||
"national_number": encryptionHelper.encryptData(
|
||||
drivers[i]['national_number'].toString()),
|
||||
"name_arabic": encryptionHelper
|
||||
.encryptData(drivers[i]['name_arabic'].toString()),
|
||||
"name_english": encryptionHelper
|
||||
.encryptData(drivers[i]['name_english'].toString()),
|
||||
"address": encryptionHelper
|
||||
.encryptData(drivers[i]['address'].toString()),
|
||||
"card_id": encryptionHelper
|
||||
.encryptData(drivers[i]['card_id'].toString()),
|
||||
"occupation": encryptionHelper
|
||||
.encryptData(drivers[i]['occupation'].toString()),
|
||||
"religion": encryptionHelper
|
||||
.encryptData(drivers[i]['religion'].toString()),
|
||||
"birthdate": encryptionHelper
|
||||
.encryptData(drivers[i]['birthdate'].toString()),
|
||||
"site": encryptionHelper
|
||||
.encryptData(drivers[i]['site'].toString()),
|
||||
"first_name": encryptionHelper
|
||||
.encryptData(drivers[i]['first_name'].toString()),
|
||||
"last_name": encryptionHelper
|
||||
.encryptData(drivers[i]['last_name'].toString()),
|
||||
"education": encryptionHelper
|
||||
.encryptData(drivers[i]['education'].toString()),
|
||||
"employmentType": encryptionHelper
|
||||
.encryptData(drivers[i]['employmentType'].toString()),
|
||||
"maritalStatus": (drivers[i]['maritalStatus'].toString()),
|
||||
"fullNameMaritial": encryptionHelper.encryptData(
|
||||
drivers[i]['fullNameMaritial'].toString()),
|
||||
'id': drivers[i]['id'].toString()
|
||||
};
|
||||
print(payload);
|
||||
// if (drivers[i]['id'].toString() !=
|
||||
// '01002165502a9sHC1tbrUrUw') {
|
||||
var result = await CRUD().post(
|
||||
link:
|
||||
'https://server.sefer.live/sefer.click/sefer/auth/captin/updateDriverSecure.php',
|
||||
payload: payload);
|
||||
if (result != 'failure') {
|
||||
print(result);
|
||||
} else {
|
||||
print('failure');
|
||||
}
|
||||
Future.delayed(Duration(microseconds: 200));
|
||||
// }
|
||||
}
|
||||
},
|
||||
icon: const Icon(
|
||||
FontAwesome5.grin_tears,
|
||||
|
||||
Reference in New Issue
Block a user