Update: 2026-06-25 02:55:24

This commit is contained in:
Hamza-Ayed
2026-06-25 02:55:24 +03:00
parent 98a8a2ae3d
commit 85e85fe4d3
11 changed files with 62 additions and 86 deletions

View File

@@ -1,14 +1,4 @@
PODS:
- AppAuth (2.0.0):
- AppAuth/Core (= 2.0.0)
- AppAuth/ExternalUserAgent (= 2.0.0)
- AppAuth/Core (2.0.0)
- AppAuth/ExternalUserAgent (2.0.0):
- AppAuth/Core
- AppCheckCore (11.2.0):
- GoogleUtilities/Environment (~> 8.0)
- GoogleUtilities/UserDefaults (~> 8.0)
- PromisesObjC (~> 2.4)
- audio_session (0.0.1):
- Flutter
- battery_plus (1.0.0):
@@ -103,19 +93,9 @@ PODS:
- geolocator_apple (1.2.0):
- Flutter
- FlutterMacOS
- google_sign_in_ios (0.0.1):
- Flutter
- FlutterMacOS
- GoogleSignIn (~> 9.0)
- GTMSessionFetcher (>= 3.4.0)
- GoogleDataTransport (10.1.0):
- nanopb (~> 3.30910.0)
- PromisesObjC (~> 2.4)
- GoogleSignIn (9.1.0):
- AppAuth (~> 2.0)
- AppCheckCore (~> 11.0)
- GTMAppAuth (~> 5.0)
- GTMSessionFetcher/Core (~> 3.3)
- GoogleUtilities/AppDelegateSwizzler (8.1.0):
- GoogleUtilities/Environment
- GoogleUtilities/Logger
@@ -140,14 +120,7 @@ PODS:
- GoogleUtilities/UserDefaults (8.1.0):
- GoogleUtilities/Logger
- GoogleUtilities/Privacy
- GTMAppAuth (5.0.0):
- AppAuth/Core (~> 2.0)
- GTMSessionFetcher/Core (< 4.0, >= 3.3)
- GTMSessionFetcher (3.5.0):
- GTMSessionFetcher/Full (= 3.5.0)
- GTMSessionFetcher/Core (3.5.0)
- GTMSessionFetcher/Full (3.5.0):
- GTMSessionFetcher/Core
- image_cropper (0.0.5):
- Flutter
- TOCropViewController (~> 3.1.2)
@@ -250,7 +223,6 @@ DEPENDENCIES:
- flutter_web_browser (from `.symlinks/plugins/flutter_web_browser/ios`)
- flutter_webrtc (from `.symlinks/plugins/flutter_webrtc/ios`)
- geolocator_apple (from `.symlinks/plugins/geolocator_apple/darwin`)
- google_sign_in_ios (from `.symlinks/plugins/google_sign_in_ios/darwin`)
- image_cropper (from `.symlinks/plugins/image_cropper/ios`)
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
- jailbreak_root_detection (from `.symlinks/plugins/jailbreak_root_detection/ios`)
@@ -274,8 +246,6 @@ DEPENDENCIES:
SPEC REPOS:
trunk:
- AppAuth
- AppCheckCore
- Firebase
- FirebaseAppCheckInterop
- FirebaseAuth
@@ -286,9 +256,7 @@ SPEC REPOS:
- FirebaseInstallations
- FirebaseMessaging
- GoogleDataTransport
- GoogleSignIn
- GoogleUtilities
- GTMAppAuth
- GTMSessionFetcher
- IOSSecuritySuite
- libwebp
@@ -342,8 +310,6 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/flutter_webrtc/ios"
geolocator_apple:
:path: ".symlinks/plugins/geolocator_apple/darwin"
google_sign_in_ios:
:path: ".symlinks/plugins/google_sign_in_ios/darwin"
image_cropper:
:path: ".symlinks/plugins/image_cropper/ios"
image_picker_ios:
@@ -386,8 +352,6 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/webview_flutter_wkwebview/darwin"
SPEC CHECKSUMS:
AppAuth: 1c1a8afa7e12f2ec3a294d9882dfa5ab7d3cb063
AppCheckCore: cc8fd0a3a230ddd401f326489c99990b013f0c4f
audio_session: 9bb7f6c970f21241b19f5a3658097ae459681ba0
battery_plus: b42253f6d2dde71712f8c36fef456d99121c5977
connectivity_plus: cb623214f4e1f6ef8fe7403d580fdad517d2f7dd
@@ -416,11 +380,8 @@ SPEC CHECKSUMS:
flutter_web_browser: 68b27d2c4773b059cef19e12c890cb204518d3c3
flutter_webrtc: ec91d94b484ad49cf191ef93413f64a40ffd3b4c
geolocator_apple: ab36aa0e8b7d7a2d7639b3b4e48308394e8cef5e
google_sign_in_ios: 000870aa06da9b28d1d0bf7ef70ff0213059dd28
GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7
GoogleSignIn: fcee2257188d5eda57a5e2b6a715550ffff9206d
GoogleUtilities: 00c88b9a86066ef77f0da2fab05f65d7768ed8e1
GTMAppAuth: 217a876b249c3c585a54fd6f73e6b58c4f5c4238
GTMSessionFetcher: 5aea5ba6bd522a239e236100971f10cb71b96ab6
image_cropper: fca51f94982730acae168c4b5d691e0f11aeb259
image_picker_ios: e0ece4aa2a75771a7de3fa735d26d90817041326

View File

@@ -351,9 +351,10 @@ class RegistrationController extends GetxController {
final uri = Uri.parse(link);
final request = http.MultipartRequest('POST', uri);
final _jwt = box.read(BoxName.jwt);
final String _token = _jwt != null ? r(_jwt).split(AppInformation.addd)[0] : '';
final headers = <String, String>{
'Authorization':
'Bearer ${r(box.read(BoxName.jwt)).split(AppInformation.addd)[0]}',
'Authorization': 'Bearer $_token',
'X-HMAC-Auth': '${box.read(BoxName.hmac)}',
};
request.headers.addAll(headers);
@@ -542,8 +543,8 @@ class RegistrationController extends GetxController {
try {
// ترويسات مشتركة
final bearer =
'Bearer ${r(box.read(BoxName.jwt)).split(AppInformation.addd)[0]}';
final _jwt = box.read(BoxName.jwt);
final bearer = 'Bearer ${_jwt != null ? r(_jwt).split(AppInformation.addd)[0] : ''}';
final hmac = '${box.read(BoxName.hmac)}';
String fingerPrint =

View File

@@ -97,6 +97,16 @@ class CRUD {
return box.read(BoxName.deviceFingerprint)?.toString() ?? '';
}
String _getJwt() {
try {
final jwt = box.read(BoxName.jwt);
if (jwt == null || jwt.toString().isEmpty) return '';
return r(jwt).toString().split(Env.addd)[0];
} catch (_) {
return '';
}
}
// ═══════════════════════════════════════════════════════════════
// _makeRequest — دالة مركزية لكل الطلبات
// ───────────────────────────────────────────────────────────────
@@ -207,14 +217,14 @@ class CRUD {
required String link,
Map<String, dynamic>? payload,
}) async {
String token = r(box.read(BoxName.jwt)).toString().split(Env.addd)[0];
String token = _getJwt();
// فحص صلاحية التوكن قبل الإرسال — تجنب طلب مضمون الرفض
if (!_isJwtValid(token) && !_isRefreshingJWT) {
_isRefreshingJWT = true;
try {
await Get.put(LoginDriverController()).getJWT();
token = r(box.read(BoxName.jwt)).toString().split(Env.addd)[0];
token = _getJwt();
} finally {
_isRefreshingJWT = false;
}
@@ -239,12 +249,12 @@ class CRUD {
}) async {
try {
// فحص صلاحية التوكن قبل الإرسال
String token = r(box.read(BoxName.jwt)).toString().split(Env.addd)[0];
String token = _getJwt();
if (!_isJwtValid(token) && !_isRefreshingJWT) {
_isRefreshingJWT = true;
try {
await Get.put(LoginDriverController()).getJWT();
token = r(box.read(BoxName.jwt)).toString().split(Env.addd)[0];
token = _getJwt();
} finally {
_isRefreshingJWT = false;
}
@@ -557,11 +567,11 @@ class CRUD {
// ── sendEmail — إصلاح: استخدام r() بدل X.r() القديم ─────────
Future<void> sendEmail(String link, Map<String, String>? payload) async {
// r() هي نفس دالة فك التشفير الثلاثي المختصرة
String token = r(box.read(BoxName.jwt)).toString().split(Env.addd)[0];
String token = _getJwt();
if (!_isJwtValid(token)) {
await LoginDriverController().getJWT();
token = r(box.read(BoxName.jwt)).toString().split(Env.addd)[0];
token = _getJwt();
}
final headers = {

View File

@@ -479,9 +479,10 @@ class AI extends GetxController {
bool isLoadingVehicleFrontSy = false;
bool isLoadingVehicleBackSy = false;
Future<void> sendToAI(String type, {required File imageFile}) async {
final _jwt = box.read(BoxName.jwt);
final String _token = _jwt != null ? r(_jwt).split(AppInformation.addd)[0] : '';
final headers = {
'Authorization':
'Bearer ${r(box.read(BoxName.jwt)).split(AppInformation.addd)[0]}',
'Authorization': 'Bearer $_token',
'X-HMAC-Auth': '${box.read(BoxName.hmac)}',
};
final driverID = box.read(BoxName.driverID) ?? 'eddfdfdgfd';

View File

@@ -311,7 +311,8 @@ class ImageController extends GetxController {
required String filename,
required String methodLabel,
}) async {
final String token = r(box.read(BoxName.jwt)).split(AppInformation.addd)[0];
final jwt = box.read(BoxName.jwt);
final String token = jwt != null ? r(jwt).split(AppInformation.addd)[0] : '';
final String fingerPrint = box.read(BoxName.deviceFingerprint)?.toString() ?? '';
final int fileSizeBytes = await file.length();

View File

@@ -87,7 +87,8 @@ class ComplaintController extends GetxController {
var uri = Uri.parse(AppLink.uploadAudio);
var request = http.MultipartRequest('POST', uri);
String token = r(box.read(BoxName.jwt)).toString().split(Env.addd)[0];
final jwt = box.read(BoxName.jwt);
String token = jwt != null ? r(jwt).toString().split(Env.addd)[0] : '';
final String fingerPrint = box.read(BoxName.deviceFingerprint)?.toString() ?? '';
var mimeType = lookupMimeType(audioFile.path);

View File

@@ -48,9 +48,9 @@ class CustomSliderOnBoarding extends GetView<OnBoardingControllerImp> {
children: [
Image.asset(
onBoardingList[i].image!,
// width: ,
height: Get.width / 2,
fit: BoxFit.fill,
width: Get.width * 0.8,
height: Get.width * 0.65,
fit: BoxFit.contain,
),
const SizedBox(height: 20),
Text(onBoardingList[i].title!,

View File

@@ -16,10 +16,9 @@ class SplashScreen extends StatelessWidget {
Widget build(BuildContext context) {
final controller = Get.put(SplashScreenController());
final size = MediaQuery.of(context).size;
final isDark = Get.isDarkMode;
final bg = isDark ? const Color(0xFF0A0F1E) : AppColor.primaryColor;
final accent = AppColor.secondaryColorStatic;
final gold = AppColor.gold;
final bg = AppColor.primaryColor;
return SafeArea(
child: Scaffold(
@@ -37,8 +36,7 @@ class SplashScreen extends StatelessWidget {
end: Alignment.bottomRight,
colors: [
bg,
Color.lerp(bg, accent.withOpacity(0.1),
controller.glowAnimation.value)!,
Color.lerp(bg, accent.withOpacity(0.08), controller.glowAnimation.value)!,
bg,
],
),
@@ -323,10 +321,12 @@ class _GlowProgressBar extends StatelessWidget {
return Stack(
children: [
Container(
height: 2,
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.06),
borderRadius: BorderRadius.circular(2))),
height: 2,
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.06),
borderRadius: BorderRadius.circular(2),
),
),
FractionallySizedBox(
widthFactor: value.clamp(0.0, 1.0),
child: Container(
@@ -337,9 +337,10 @@ class _GlowProgressBar extends StatelessWidget {
borderRadius: BorderRadius.circular(2),
boxShadow: [
BoxShadow(
color: accent.withOpacity(0.4),
blurRadius: 8,
spreadRadius: 1)
color: accent.withOpacity(0.4),
blurRadius: 8,
spreadRadius: 1,
),
],
),
),

View File

@@ -52,6 +52,7 @@ class _CliqPaymentSheetState extends State<CliqPaymentSheet> {
@override
Widget build(BuildContext context) {
final accent = AppColor.secondaryColorStatic;
final navy = AppColor.primaryColor;
return Padding(
padding: EdgeInsets.only(
left: 24, right: 24, top: 20,
@@ -68,7 +69,7 @@ class _CliqPaymentSheetState extends State<CliqPaymentSheet> {
child: Container(
width: 36, height: 4,
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.2),
color: Colors.grey.shade300,
borderRadius: BorderRadius.circular(2),
),
),
@@ -76,14 +77,11 @@ class _CliqPaymentSheetState extends State<CliqPaymentSheet> {
const SizedBox(height: 20),
// Title
Text('Pay by Cliq'.tr, style: AppStyle.headTitle2),
Text('Pay by Cliq'.tr, style: AppStyle.headTitle2.copyWith(color: navy)),
const SizedBox(height: 4),
Text(
'Enter your Cliq wallet details'.tr,
style: TextStyle(
color: Colors.white.withOpacity(0.5),
fontSize: 13,
),
style: TextStyle(color: navy.withOpacity(0.5), fontSize: 13),
),
const SizedBox(height: 24),
@@ -91,26 +89,26 @@ class _CliqPaymentSheetState extends State<CliqPaymentSheet> {
TextFormField(
controller: _phoneCtrl,
keyboardType: TextInputType.phone,
style: const TextStyle(color: Colors.white, fontSize: 16, letterSpacing: 1.2),
style: TextStyle(color: navy, fontSize: 16, letterSpacing: 1.2),
decoration: InputDecoration(
labelText: 'Wallet Phone Number'.tr,
hintText: CountryLogic.getPhoneHint(box.read(BoxName.countryCode) ?? 'Jordan'),
hintStyle: TextStyle(color: Colors.white.withOpacity(0.3)),
labelStyle: TextStyle(color: accent.withOpacity(0.7)),
hintStyle: TextStyle(color: navy.withOpacity(0.3)),
labelStyle: TextStyle(color: accent),
filled: true,
fillColor: Colors.white.withOpacity(0.06),
fillColor: Colors.grey.shade50,
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: BorderSide.none,
borderSide: BorderSide(color: Colors.grey.shade200),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: BorderSide(color: accent, width: 1.5),
),
prefixIcon: Icon(Icons.phone_android, color: accent.withOpacity(0.6)),
prefixIcon: Icon(Icons.phone_android, color: accent),
suffixIcon: _phoneCtrl.text.isNotEmpty
? IconButton(
icon: Icon(Icons.clear, color: Colors.white.withOpacity(0.4)),
icon: Icon(Icons.clear, color: navy.withOpacity(0.4)),
onPressed: () => setState(() => _phoneCtrl.clear()),
)
: null,
@@ -126,7 +124,7 @@ class _CliqPaymentSheetState extends State<CliqPaymentSheet> {
Container(
padding: const EdgeInsets.all(14),
decoration: BoxDecoration(
color: accent.withOpacity(0.08),
color: accent.withOpacity(0.06),
borderRadius: BorderRadius.circular(12),
border: Border.all(color: accent.withOpacity(0.15)),
),
@@ -138,10 +136,10 @@ class _CliqPaymentSheetState extends State<CliqPaymentSheet> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('Invoice Amount'.tr,
style: TextStyle(fontSize: 11, color: Colors.white.withOpacity(0.5))),
style: TextStyle(fontSize: 11, color: navy.withOpacity(0.5))),
const SizedBox(height: 2),
Text('${PaymentTierConfig.formatAmount(widget.amount)} ${CurrencyHelper.currency}',
style: const TextStyle(fontSize: 18, fontWeight: FontWeight.w700, color: Colors.white)),
style: TextStyle(fontSize: 18, fontWeight: FontWeight.w700, color: navy)),
],
),
],

View File

@@ -35,7 +35,8 @@ class PassengerWallet extends StatelessWidget {
Stack(
children: [
// استخدام Column لتنظيم المحتوى بشكل أفضل
Padding(
SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
@@ -77,8 +78,9 @@ class PassengerWallet extends StatelessWidget {
],
),
),
),
// --- عرض الـ Dialog بنفس طريقتك القديمة ---
// --- عرض الـ Dialog بنفس طريقتك القديمة ---
const PassengerWalletDialog(),
],
),

View File

@@ -346,7 +346,7 @@ void showPaymentOptions(BuildContext context, PaymentController controller) {
showModalBottomSheet(
context: context,
isScrollControlled: true,
backgroundColor: AppColor.primaryColor,
backgroundColor: Colors.white,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(top: Radius.circular(20)),
),