fix marker rendering & modernize riding widgets for dark mode - 2026-04-11
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import 'package:Intaleq/print.dart';
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
import 'dart:typed_data';
|
||||
@@ -11,25 +12,25 @@ Future<bool> verifyCertificateManually(
|
||||
|
||||
final certificate = socket.peerCertificate;
|
||||
if (certificate == null) {
|
||||
print("❌ لا يوجد شهادة.");
|
||||
Log.print("❌ لا يوجد شهادة.");
|
||||
return false;
|
||||
}
|
||||
|
||||
final der = certificate.der;
|
||||
final actualPin = base64.encode(sha256.convert(der).bytes);
|
||||
|
||||
print("📛 HOST: $host");
|
||||
print("📜 Subject: ${certificate.subject}");
|
||||
print("📜 Issuer: ${certificate.issuer}");
|
||||
print("📅 Valid From: ${certificate.startValidity}");
|
||||
print("📅 Valid To: ${certificate.endValidity}");
|
||||
print(
|
||||
Log.print("📛 HOST: $host");
|
||||
Log.print("📜 Subject: ${certificate.subject}");
|
||||
Log.print("📜 Issuer: ${certificate.issuer}");
|
||||
Log.print("📅 Valid From: ${certificate.startValidity}");
|
||||
Log.print("📅 Valid To: ${certificate.endValidity}");
|
||||
Log.print(
|
||||
"🔐 Server Pin: $actualPin → ${actualPin == expectedPin ? '✅ MATCH' : '❌ MISMATCH'}");
|
||||
|
||||
socket.destroy();
|
||||
return actualPin == expectedPin;
|
||||
} catch (e) {
|
||||
print("❌ خطأ أثناء الاتصال أو الفحص: $e");
|
||||
Log.print("❌ خطأ أثناء الاتصال أو الفحص: $e");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -37,4 +38,4 @@ Future<bool> verifyCertificateManually(
|
||||
/// تحويل المفتاح العام إلى بصمة SHA-256
|
||||
List<int> sha256Convert(Uint8List der) {
|
||||
return sha256.convert(der).bytes;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
import 'dart:io';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -8,6 +7,7 @@ import 'package:url_launcher/url_launcher.dart';
|
||||
import '../../constant/box_name.dart';
|
||||
import '../../constant/links.dart';
|
||||
import '../../main.dart';
|
||||
import '../../print.dart';
|
||||
import '../functions/crud.dart';
|
||||
import '../../onbording_page.dart';
|
||||
import 'login_controller.dart';
|
||||
@@ -38,7 +38,9 @@ class GoogleSignInHelper {
|
||||
// silent login if possible
|
||||
try {
|
||||
await _signIn.attemptLightweightAuthentication();
|
||||
} catch (_) {}
|
||||
} catch (e) {
|
||||
Log.print("Error: $e");
|
||||
}
|
||||
}
|
||||
|
||||
/// ✅ تسجيل دخول عادي
|
||||
@@ -46,16 +48,14 @@ class GoogleSignInHelper {
|
||||
try {
|
||||
final user =
|
||||
await _signIn.authenticate(scopeHint: const ['email', 'profile']);
|
||||
if (user != null) {
|
||||
_lastUser = user;
|
||||
await _handleSignUp(user);
|
||||
_lastUser = user;
|
||||
await _handleSignUp(user);
|
||||
|
||||
// اطبع القيم (للتأكد)
|
||||
print("Google ID: ${user.id}");
|
||||
print("Email: ${user.email}");
|
||||
print("Name: ${user.displayName}");
|
||||
print("Photo: ${user.photoUrl}");
|
||||
}
|
||||
// اطبع القيم (للتأكد)
|
||||
Log.print("Google ID: ${user.id}");
|
||||
Log.print("Email: ${user.email}");
|
||||
Log.print("Name: ${user.displayName}");
|
||||
Log.print("Photo: ${user.photoUrl}");
|
||||
return user;
|
||||
} on PlatformException catch (e) {
|
||||
if (e.code == 'sign_in_required') {
|
||||
|
||||
@@ -119,11 +119,11 @@ class PhoneAuthHelper {
|
||||
|
||||
if (response != 'failure') {
|
||||
final data = (response);
|
||||
// Log.print('data: ${data}');
|
||||
Log.print('data: ${data}');
|
||||
|
||||
if (data['status'] == 'success') {
|
||||
final isRegistered = data['message']['isRegistered'] ?? false;
|
||||
// Log.print('isRegistered: ${isRegistered}');
|
||||
Log.print('isRegistered: ${isRegistered}');
|
||||
|
||||
if (isRegistered) {
|
||||
// ✅ المستخدم موجود مسبقاً -> تسجيل دخول مباشر
|
||||
@@ -148,18 +148,14 @@ class PhoneAuthHelper {
|
||||
static Future<void> _addTokens() async {
|
||||
String fingerPrint = await DeviceHelper.getDeviceFingerprint();
|
||||
|
||||
await CRUD()
|
||||
.post(link: "${AppLink.server}/ride/firebase/add.php", payload: {
|
||||
'token': (box.read(BoxName.tokenFCM.toString())),
|
||||
'passengerID': box.read(BoxName.passengerID).toString(),
|
||||
"fingerPrint": fingerPrint
|
||||
});
|
||||
await CRUD()
|
||||
.post(link: "${AppLink.paymentServer}/ride/firebase/add.php", payload: {
|
||||
var res = await CRUD()
|
||||
// this for register and login //
|
||||
.post(link: "${AppLink.server}/ride/firebase/addToken.php", payload: {
|
||||
'token': (box.read(BoxName.tokenFCM.toString())),
|
||||
'passengerID': box.read(BoxName.passengerID).toString(),
|
||||
"fingerPrint": fingerPrint
|
||||
});
|
||||
Log.print('res token: ${res}');
|
||||
}
|
||||
|
||||
static Future<void> registerUser({
|
||||
|
||||
Reference in New Issue
Block a user