25-1/25/1-secure and links
This commit is contained in:
@@ -486,7 +486,7 @@ class UserAccountHeader extends StatelessWidget {
|
||||
: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(50),
|
||||
child: Image.network(
|
||||
'${AppLink.seferCairoServer}/portrate_captain_image/${encryptionHelper.decryptData(box.read(BoxName.driverID))}.jpg',
|
||||
'${AppLink.seferCairoServer}/portrate_captain_image/${(box.read(BoxName.driverID))}.jpg',
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -15,7 +15,6 @@ import 'package:bubble_head/bubble.dart';
|
||||
import '../../../../constant/colors.dart';
|
||||
import '../../../../constant/info.dart';
|
||||
import '../../../../constant/style.dart';
|
||||
import '../../../../controller/functions/encrypt_decrypt.dart';
|
||||
import '../../../../controller/functions/location_controller.dart';
|
||||
import '../../../../controller/functions/overlay_permisssion.dart';
|
||||
import '../../../../controller/functions/package_info.dart';
|
||||
@@ -24,7 +23,6 @@ import '../../../widgets/circle_container.dart';
|
||||
import '../driver_map_page.dart';
|
||||
import 'widget/connect.dart';
|
||||
import 'widget/left_menu_map_captain.dart';
|
||||
import '../../../../controller/home/payment/captain_wallet_controller.dart';
|
||||
import '../../../../main.dart';
|
||||
|
||||
class HomeCaptain extends StatelessWidget {
|
||||
@@ -229,7 +227,7 @@ class HomeCaptain extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
'${"Today".tr}: ${encryptionHelper.decryptData(homeCaptainController.totalMoneyToday)}',
|
||||
'${"Today".tr}: ${(homeCaptainController.totalMoneyToday)}',
|
||||
style: AppStyle.title.copyWith(
|
||||
color: AppColor.greenColor,
|
||||
fontWeight: FontWeight.bold,
|
||||
@@ -253,7 +251,7 @@ class HomeCaptain extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
'${AppInformation.appName}: ${encryptionHelper.decryptData(homeCaptainController.totalMoneyInSEFER)}',
|
||||
'${AppInformation.appName}: ${(homeCaptainController.totalMoneyInSEFER)}',
|
||||
style: AppStyle.title.copyWith(
|
||||
color: AppColor.yellowColor,
|
||||
fontWeight: FontWeight.bold,
|
||||
@@ -268,7 +266,7 @@ class HomeCaptain extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'${'Total Points is'.tr}: ${encryptionHelper.decryptData(homeCaptainController.totalPoints)}',
|
||||
'${'Total Points is'.tr}: ${(homeCaptainController.totalPoints)}',
|
||||
style: AppStyle.title.copyWith(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
@@ -279,19 +277,15 @@ class HomeCaptain extends StatelessWidget {
|
||||
horizontal: 12, vertical: 6),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
color: int.parse(encryptionHelper.decryptData(
|
||||
homeCaptainController
|
||||
.countRideToday)) <
|
||||
color: int.parse((homeCaptainController
|
||||
.countRideToday)) <
|
||||
5
|
||||
? AppColor.accentColor
|
||||
: int.parse(encryptionHelper.decryptData(
|
||||
homeCaptainController
|
||||
.countRideToday)) >
|
||||
: int.parse((homeCaptainController
|
||||
.countRideToday)) >
|
||||
5 &&
|
||||
int.parse(
|
||||
encryptionHelper.decryptData(
|
||||
homeCaptainController
|
||||
.countRideToday)) <
|
||||
int.parse((homeCaptainController
|
||||
.countRideToday)) <
|
||||
10
|
||||
? AppColor.yellowColor
|
||||
: AppColor.greenColor,
|
||||
@@ -305,7 +299,7 @@ class HomeCaptain extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
'${"Ride Today : ".tr}: ${encryptionHelper.decryptData(homeCaptainController.countRideToday)}',
|
||||
'${"Ride Today : ".tr}: ${(homeCaptainController.countRideToday)}',
|
||||
style: AppStyle.title.copyWith(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
@@ -356,8 +350,7 @@ class HomeCaptain extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
encryptionHelper.decryptData(
|
||||
homeCaptainController.stringActiveDuration),
|
||||
(homeCaptainController.stringActiveDuration),
|
||||
style: AppStyle.title.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: AppColor.greenColor,
|
||||
@@ -378,8 +371,7 @@ class HomeCaptain extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
encryptionHelper.decryptData(
|
||||
homeCaptainController.totalDurationToday),
|
||||
(homeCaptainController.totalDurationToday),
|
||||
style: AppStyle.title.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: AppColor.accentColor,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:sefer_driver/constant/style.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/auth/captin/criminal_documents_page.dart';
|
||||
import 'package:sefer_driver/views/widgets/elevated_btn.dart';
|
||||
@@ -79,8 +80,9 @@ class ProfileCaptain extends StatelessWidget {
|
||||
''),
|
||||
phoneNumber:
|
||||
controller.captainProfileData['phone'] ?? '',
|
||||
email:
|
||||
controller.captainProfileData['email'] ?? '',
|
||||
email: encryptionHelper.decryptData(
|
||||
controller.captainProfileData['email']) ??
|
||||
'',
|
||||
birthdate:
|
||||
controller.captainProfileData['birthdate'] ??
|
||||
'',
|
||||
@@ -105,8 +107,8 @@ class ProfileCaptain extends StatelessWidget {
|
||||
expirationDate: controller
|
||||
.captainProfileData['expiration_date'] ??
|
||||
'',
|
||||
ratingCount: controller
|
||||
.captainProfileData['ratingCount'] ??
|
||||
ratingCount: int.parse(controller
|
||||
.captainProfileData['ratingCount']) ??
|
||||
0,
|
||||
ratingDriver: controller
|
||||
.captainProfileData['ratingDriver'] !=
|
||||
@@ -116,7 +118,9 @@ class ProfileCaptain extends StatelessWidget {
|
||||
.toString()) ??
|
||||
0
|
||||
: null,
|
||||
age: controller.captainProfileData['age'] ?? 0,
|
||||
age: int.parse(
|
||||
controller.captainProfileData['age']) ??
|
||||
0,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user