25-4-29/1
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:Tripz/constant/char_map.dart';
|
||||
import 'package:Tripz/controller/functions/crud.dart';
|
||||
import 'package:Tripz/controller/functions/encrypt_decrypt.dart';
|
||||
import 'package:Tripz/env/env.dart';
|
||||
import 'package:firebase_auth/firebase_auth.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -15,13 +13,11 @@ import 'package:Tripz/constant/colors.dart';
|
||||
import 'package:Tripz/constant/style.dart';
|
||||
import 'package:Tripz/main.dart';
|
||||
import 'package:Tripz/views/widgets/my_scafold.dart';
|
||||
import 'package:secure_string_operations/secure_string_operations.dart';
|
||||
|
||||
import '../../constant/info.dart';
|
||||
import '../../controller/auth/apple_signin_controller.dart';
|
||||
import '../../controller/auth/google_sign.dart';
|
||||
import '../../controller/auth/login_controller.dart';
|
||||
import '../../print.dart';
|
||||
import '../home/HomePage/contact_us.dart';
|
||||
import '../home/profile/passenger_profile_page.dart';
|
||||
|
||||
@@ -334,7 +330,8 @@ class LoginPage extends StatelessWidget {
|
||||
const SizedBox(height: 20),
|
||||
ElevatedButton(
|
||||
onPressed: () async => await controller.getLocationPermission(),
|
||||
child: Text('Allow Location Access'.tr),
|
||||
child: Text('Next'.tr),
|
||||
// child: Text('Allow Location Access'.tr),
|
||||
),
|
||||
// TextButton(
|
||||
// onPressed: () => openAppSettings(),
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:Tripz/constant/links.dart';
|
||||
import 'package:Tripz/controller/auth/login_controller.dart';
|
||||
import 'package:Tripz/controller/functions/crud.dart';
|
||||
import 'package:Tripz/controller/functions/sms_controller.dart';
|
||||
import 'package:Tripz/views/widgets/error_snakbar.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:Tripz/constant/box_name.dart';
|
||||
import 'package:Tripz/main.dart';
|
||||
@@ -5,13 +12,17 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
import 'package:jwt_decoder/jwt_decoder.dart';
|
||||
import 'package:secure_string_operations/secure_string_operations.dart';
|
||||
import '../../../constant/char_map.dart';
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../controller/auth/login_controller.dart';
|
||||
import '../../../constant/info.dart';
|
||||
import '../../../controller/functions/encrypt_decrypt.dart';
|
||||
import '../../../controller/functions/package_info.dart';
|
||||
import '../../../controller/functions/tts.dart';
|
||||
import '../../../controller/home/map_passenger_controller.dart';
|
||||
import '../../../controller/home/vip_waitting_page.dart';
|
||||
import '../../../controller/payment/paymob/paymob_response.dart';
|
||||
import '../../../print.dart';
|
||||
|
||||
GetBuilder<MapPassengerController> leftMainMenuIcons() {
|
||||
Get.put(TextToSpeechController());
|
||||
@@ -59,15 +70,15 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
|
||||
onPressed: () => Get.to(() => VipWaittingPage()),
|
||||
tooltip: 'VIP Waiting Page', // More descriptive tooltip
|
||||
),
|
||||
// const SizedBox(width: 8),
|
||||
// _buildIconButtonWithAnimation(
|
||||
// controller: controller,
|
||||
// icon: Octicons.screen_full,
|
||||
// onPressed: () async {
|
||||
// Get.to(() => TestPage());
|
||||
// },
|
||||
// tooltip: 'Recent Locations', // More descriptive tooltip
|
||||
// ),
|
||||
const SizedBox(width: 8),
|
||||
_buildIconButtonWithAnimation(
|
||||
controller: controller,
|
||||
icon: Octicons.screen_full,
|
||||
onPressed: () async {
|
||||
Get.to(() => TestPage());
|
||||
},
|
||||
tooltip: 'Recent Locations', // More descriptive tooltip
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -86,11 +97,34 @@ class TestPage extends StatelessWidget {
|
||||
body: Center(
|
||||
child: TextButton(
|
||||
onPressed: () async {
|
||||
// await DeviceHelper.getDeviceFingerprint();
|
||||
// await SecurityHelper.performSecurityChecks();
|
||||
LoginController().getJwtWallet();
|
||||
// addFingerPrint() async {
|
||||
// bool isTokenExpired = JwtDecoder.isExpired(X
|
||||
// .r(X.r(X.r(box.read(BoxName.jwt), cn), cC), cs)
|
||||
// .toString()
|
||||
// .split(AppInformation.addd)[0]);
|
||||
|
||||
// if (isTokenExpired) {
|
||||
// Log.print(
|
||||
// 'isTokenExpired loginUsingCredentials: ${isTokenExpired}');
|
||||
// await LoginController().getJWT();
|
||||
// }
|
||||
|
||||
// var res = await CRUD().get(
|
||||
// link: 'https://server.sefer.click/sefer.click/sefer/test.php',
|
||||
// payload: {
|
||||
// 'email': box.read(BoxName.email).toString(),
|
||||
// 'id': box.read(BoxName.passengerID).toString(),
|
||||
// "platform": Platform.isAndroid ? 'android' : 'ios',
|
||||
// "appName": AppInformation.appName,
|
||||
// });
|
||||
// Log.print('res: ${res}');
|
||||
// var s = EncryptionHelper.instance.encryptData('Female');
|
||||
Log.print('s: ${box.read(BoxName.hmac)}');
|
||||
},
|
||||
|
||||
// uDG41L0K5vrem0eh87ZAf9leTrDUW0+twVRHQIQtxOWn4L6J5seU9x1tnRUUbGBb
|
||||
|
||||
// uDG41L0K5vrem0eh87ZAf9leTrDUW0+twVRHQIQtxOU=
|
||||
|
||||
child: Text(
|
||||
"Text Button",
|
||||
),
|
||||
|
||||
@@ -243,18 +243,17 @@ void showPaymentOptions(BuildContext context, PaymentController controller) {
|
||||
box.read(BoxName.countryCode) == 'Egypt'
|
||||
? CupertinoActionSheetAction(
|
||||
child: Text('💳 Pay with Credit Card'.tr),
|
||||
onPressed: () {
|
||||
onPressed: () async {
|
||||
if (controller.selectedAmount != 0) {
|
||||
controller.payWithPayMob(
|
||||
context,
|
||||
controller.selectedAmount.toString(),
|
||||
box.read(BoxName.countryCode) == 'Egypt' ? 'EGP' : 'JOD',
|
||||
() async {
|
||||
await controller.addPassengerWallet();
|
||||
controller.changePromoSheetDialogue();
|
||||
await controller.getPassengerWallet();
|
||||
},
|
||||
// () async {
|
||||
// await controller.addPassengerWallet();
|
||||
// controller.changePromoSheetDialogue();
|
||||
);
|
||||
await controller.getPassengerWallet();
|
||||
} else {
|
||||
Toast.show(context, '⚠️ You need to choose an amount!'.tr,
|
||||
AppColor.redColor);
|
||||
@@ -278,7 +277,7 @@ void showPaymentOptions(BuildContext context, PaymentController controller) {
|
||||
box.read(BoxName.phoneWallet) != null
|
||||
? CupertinoActionSheetAction(
|
||||
child: Text('💰 Pay with Wallet'.tr),
|
||||
onPressed: () {
|
||||
onPressed: () async {
|
||||
if (controller.selectedAmount != 0) {
|
||||
controller.isLoading = true;
|
||||
controller.update();
|
||||
@@ -286,12 +285,8 @@ void showPaymentOptions(BuildContext context, PaymentController controller) {
|
||||
context,
|
||||
controller.selectedAmount.toString(),
|
||||
box.read(BoxName.countryCode) == 'Egypt' ? 'EGP' : 'JOD',
|
||||
() async {
|
||||
await controller.addPassengerWallet();
|
||||
controller.changePromoSheetDialogue();
|
||||
await controller.getPassengerWallet();
|
||||
},
|
||||
);
|
||||
await controller.getPassengerWallet();
|
||||
controller.isLoading = false;
|
||||
controller.update();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user