fix: stabilize passenger mapping interactions and finalize localization
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:Intaleq/constant/api_key.dart';
|
||||
import 'package:Intaleq/controller/firebase/firbase_messge.dart';
|
||||
import 'package:Intaleq/views/auth/otp_page.dart';
|
||||
@@ -10,7 +10,7 @@ import 'package:http/http.dart' as http;
|
||||
import 'package:Intaleq/constant/info.dart';
|
||||
import 'package:Intaleq/controller/functions/add_error.dart';
|
||||
import 'package:Intaleq/views/auth/login_page.dart';
|
||||
import 'package:Intaleq/views/auth/sms_verfy_page.dart';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:Intaleq/constant/box_name.dart';
|
||||
@@ -18,17 +18,16 @@ import 'package:Intaleq/constant/links.dart';
|
||||
import 'package:Intaleq/controller/functions/crud.dart';
|
||||
import 'package:Intaleq/main.dart';
|
||||
import 'package:Intaleq/views/home/map_page_passenger.dart';
|
||||
import 'package:jwt_decoder/jwt_decoder.dart';
|
||||
import 'package:location/location.dart';
|
||||
import 'package:secure_string_operations/secure_string_operations.dart';
|
||||
|
||||
import '../../constant/char_map.dart';
|
||||
import 'package:location/location.dart';
|
||||
|
||||
|
||||
|
||||
import '../../print.dart';
|
||||
import '../../views/auth/otp_token_page.dart';
|
||||
import '../functions/encrypt_decrypt.dart';
|
||||
import '../functions/package_info.dart';
|
||||
import '../functions/secure_storage.dart';
|
||||
import '../functions/securty_check.dart';
|
||||
|
||||
|
||||
class LoginController extends GetxController {
|
||||
final formKey = GlobalKey<FormState>();
|
||||
@@ -88,20 +87,7 @@ class LoginController extends GetxController {
|
||||
update();
|
||||
}
|
||||
|
||||
void _showJwtErrorDialog(String message) {
|
||||
if (Get.context == null) return;
|
||||
|
||||
Get.defaultDialog(
|
||||
title: "خطأ في الاتصال",
|
||||
middleText: message,
|
||||
textConfirm: "إعادة المحاولة",
|
||||
confirmTextColor: Colors.white,
|
||||
onConfirm: () {
|
||||
Get.back();
|
||||
getJwtWallet();
|
||||
},
|
||||
);
|
||||
}
|
||||
// ═══════════════════════════════════════════════════════════════
|
||||
// LoginController — دوال إدارة الـ JWT
|
||||
// ───────────────────────────────────────────────────────────────
|
||||
@@ -141,8 +127,8 @@ class LoginController extends GetxController {
|
||||
);
|
||||
Log.print('AppLink.loginFirstTime: ${AppLink.loginFirstTime}');
|
||||
|
||||
Log.print('payload: ${payload}');
|
||||
Log.print('response: ${response}');
|
||||
Log.print('payload: $payload');
|
||||
Log.print('response: $response');
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
final decoded = jsonDecode(response.body);
|
||||
@@ -169,7 +155,7 @@ class LoginController extends GetxController {
|
||||
);
|
||||
Log.print('AppLink.loginJwtRider: ${AppLink.loginJwtRider}');
|
||||
|
||||
Log.print('payload: ${payload}');
|
||||
Log.print('payload: $payload');
|
||||
Log.print('response: ${response.body}');
|
||||
if (response.statusCode == 200) {
|
||||
final decoded = jsonDecode(response.body);
|
||||
@@ -361,7 +347,7 @@ class LoginController extends GetxController {
|
||||
}
|
||||
|
||||
Get.offAll(() => const MapPagePassenger());
|
||||
} catch (e, st) {
|
||||
} catch (e) {
|
||||
addError('$e', 'loginUsingCredentials');
|
||||
Get.snackbar('Error', e.toString(), backgroundColor: Colors.redAccent);
|
||||
} finally {
|
||||
@@ -433,7 +419,7 @@ class LoginController extends GetxController {
|
||||
}
|
||||
}
|
||||
|
||||
goToMapPage() {
|
||||
void goToMapPage() {
|
||||
if (box.read(BoxName.email) != null) {
|
||||
Get.offAll(() => const MapPagePassenger());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user