diff --git a/android/build/reports/problems/problems-report.html b/android/build/reports/problems/problems-report.html
index b3afce9..ad0a4cf 100644
--- a/android/build/reports/problems/problems-report.html
+++ b/android/build/reports/problems/problems-report.html
@@ -650,7 +650,7 @@ code + .copy-button {
diff --git a/compare.sh b/compare.sh
new file mode 100644
index 0000000..4f69352
--- /dev/null
+++ b/compare.sh
@@ -0,0 +1,83 @@
+#!/bin/bash
+
+ORIG_FILE="lib/controller/home/map_passenger_controller.dart"
+SPLIT_DIR="lib/controller/home/map"
+
+echo "Extracting methods from original controller..."
+# Methods typically start with spaces and have patterns like:
+# returnType methodName( or methodName(
+# Let's extract words that precede ( on lines that don't start with keywords (if, for, while, switch, catch, etc.)
+# We will use awk to parse.
+METHODS=$(cat "$ORIG_FILE" | awk '
+# Skip single-line comments
+/\/\// { next }
+# Skip imports and class declarations
+/import/ || /class/ { next }
+# Find lines with "("
+/\(/ {
+ # Replace anything inside parentheses and curly braces to simplify
+ gsub(/\(.*\)/, "()")
+ # Find word before "()"
+ for (i = 1; i <= NF; i++) {
+ if ($i ~ /[a-zA-Z0-9_]+\(\)/) {
+ name = $i
+ sub(/\(\)/, "", name)
+ # Remove any leading modifiers like async, Future, static, etc.
+ # Only keep valid identifiers that are not control keywords
+ if (name !~ /^(if|for|while|switch|catch|super|await|print|assert|dynamic|void|return|with|override|get|set|else|try|final|const|var|late|static|factory|new|abstract|covariant|external|operator|part|required|typedef|yield)$/ && name ~ /^[a-zA-Z_][a-zA-Z0-9_]*$/) {
+ print name
+ }
+ }
+ }
+}' | sort -u)
+
+echo "Extracting fields/variables from original controller..."
+# Fields are usually declared inside the class at the beginning of lines or indented.
+# e.g., RxBool isSearching = false.obs; or String? rideId;
+VARS=$(cat "$ORIG_FILE" | awk '
+/\/\// { next }
+/import/ || /class/ { next }
+# Lines ending with ";" or containing "=" followed by ";"
+/;/ {
+ # Extract words that look like declarations.
+ # We look for typical type names or var/final followed by variable name
+ for (i = 1; i < NF; i++) {
+ if ($i ~ /^(var|final|const|late|RxBool|RxInt|RxDouble|RxString|RxList|RxMap|RxSet|Rx|String|int|double|bool|List|Map|Set|Timer|LatLng|Position|IntaleqMapController)$/) {
+ # The next field might be the variable name, or it might have a type like String?
+ name = $(i+1)
+ # Remove trailing ?, ;, =
+ sub(/\?/, "", name)
+ sub(/;/, "", name)
+ sub(/=/, "", name)
+ if (name ~ /^[a-zA-Z_][a-zA-Z0-9_]*$/) {
+ print name
+ }
+ }
+ }
+}' | sort -u)
+
+echo "Checking split files for methods..."
+echo "--- MISSING METHODS ---"
+MISSING_METHODS_COUNT=0
+for method in $METHODS; do
+ # Search for this method name as a whole word in split controllers
+ FOUND=$(grep -rw "$method" "$SPLIT_DIR" 2>/dev/null)
+ if [ -z "$FOUND" ]; then
+ echo " - $method"
+ MISSING_METHODS_COUNT=$((MISSING_METHODS_COUNT+1))
+ fi
+done
+echo "Total missing methods: $MISSING_METHODS_COUNT"
+
+echo ""
+echo "Checking split files for variables/fields..."
+echo "--- MISSING VARIABLES ---"
+MISSING_VARS_COUNT=0
+for var in $VARS; do
+ FOUND=$(grep -rw "$var" "$SPLIT_DIR" 2>/dev/null)
+ if [ -z "$FOUND" ]; then
+ echo " - $var"
+ MISSING_VARS_COUNT=$((MISSING_VARS_COUNT+1))
+ fi
+done
+echo "Total missing variables: $MISSING_VARS_COUNT"
diff --git a/compare_controllers.py b/compare_controllers.py
new file mode 100644
index 0000000..569b552
--- /dev/null
+++ b/compare_controllers.py
@@ -0,0 +1,79 @@
+import os
+import re
+
+original_path = 'lib/controller/home/map_passenger_controller.dart'
+split_dir = 'lib/controller/home/map'
+
+# Read original file
+with open(original_path, 'r', encoding='utf-8') as f:
+ orig_content = f.read()
+
+# Read all split files
+split_contents = {}
+for filename in os.listdir(split_dir):
+ if filename.endswith('.dart') and filename != 'map_screen_binding.dart':
+ filepath = os.path.join(split_dir, filename)
+ with open(filepath, 'r', encoding='utf-8') as f:
+ split_contents[filename] = f.read()
+
+# Combined content of all split files
+combined_split_content = '\n'.join(split_contents.values())
+
+# Regex to find method/function declarations inside a class in Dart
+keywords = {
+ 'if', 'for', 'while', 'switch', 'catch', 'super', 'await', 'print',
+ 'assert', 'dynamic', 'void', 'return', 'with', 'override', 'get', 'set',
+ 'class', 'import', 'extends', 'implements', 'mixin', 'this', 'else', 'try',
+ 'final', 'const', 'var', 'late', 'static', 'factory', 'new', 'abstract',
+ 'covariant', 'external', 'operator', 'part', 'required', 'typedef', 'yield'
+}
+
+def strip_comments(text):
+ text = re.sub(r'/\*.*?\*/', '', text, flags=re.DOTALL)
+ text = re.sub(r'//.*', '', text)
+ return text
+
+orig_clean = strip_comments(orig_content)
+combined_split_clean = strip_comments(combined_split_content)
+
+method_decl_pattern = re.compile(
+ r'(?:[a-zA-Z0-9_<>\?\[\]]+(?:\s+[a-zA-Z0-9_<>\?\[\]]+)*\s+)?([a-zA-Z0-9_]+)\s*\([^\)]*\)\s*(?:async)?\s*(?:=>|\{)'
+)
+
+original_methods = set()
+for match in method_decl_pattern.finditer(orig_clean):
+ method_name = match.group(1)
+ if method_name not in keywords and not method_name.isdigit():
+ original_methods.add(method_name)
+
+var_decl_pattern = re.compile(
+ r'\b(?:var|final|const|late|Rx[a-zA-Z]+|String|int|double|bool|List|Map|Set|Timer|LatLng|Position|IntaleqMapController)\??\s+([a-zA-Z0-9_]+)\b'
+)
+
+original_vars = set()
+for match in var_decl_pattern.finditer(orig_clean):
+ var_name = match.group(1)
+ if var_name not in keywords and not var_name.isdigit():
+ original_vars.add(var_name)
+
+missing_methods = []
+for method in sorted(original_methods):
+ if not re.search(r'\b' + re.escape(method) + r'\b', combined_split_clean):
+ missing_methods.append(method)
+
+missing_vars = []
+for var in sorted(original_vars):
+ if not re.search(r'\b' + re.escape(var) + r'\b', combined_split_clean):
+ missing_vars.append(var)
+
+print("--- MISSING METHODS ---")
+print(f"Total original methods found: {len(original_methods)}")
+print(f"Total missing: {len(missing_methods)}")
+for m in missing_methods:
+ print(f" - {m}")
+
+print("\n--- MISSING VARIABLES/FIELDS ---")
+print(f"Total original variables found: {len(original_vars)}")
+print(f"Total missing: {len(missing_vars)}")
+for v in missing_vars:
+ print(f" - {v}")
diff --git a/comparison_results.txt b/comparison_results.txt
new file mode 100644
index 0000000..e69de29
diff --git a/ios/Podfile b/ios/Podfile
index 16d4165..f61c2cb 100644
--- a/ios/Podfile
+++ b/ios/Podfile
@@ -46,6 +46,11 @@ post_install do |installer|
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
'$(inherited)',
'PERMISSION_CONTACTS=1',
+ 'PERMISSION_LOCATION=1',
+ 'PERMISSION_MICROPHONE=1',
+ 'PERMISSION_NOTIFICATIONS=1',
+ 'PERMISSION_CAMERA=1',
+ 'PERMISSION_PHOTOS=1',
]
end
end
diff --git a/ios/Podfile.lock b/ios/Podfile.lock
index f133cdf..2b95974 100644
--- a/ios/Podfile.lock
+++ b/ios/Podfile.lock
@@ -81,6 +81,9 @@ PODS:
- FlutterMacOS
- flutter_tts (0.0.1):
- Flutter
+ - flutter_webrtc (1.4.0):
+ - Flutter
+ - WebRTC-SDK (= 144.7559.01)
- geolocator_apple (1.2.0):
- Flutter
- FlutterMacOS
@@ -246,6 +249,7 @@ PODS:
- FlutterMacOS
- wakelock_plus (0.0.1):
- Flutter
+ - WebRTC-SDK (144.7559.01)
- webview_flutter_wkwebview (0.0.1):
- Flutter
- FlutterMacOS
@@ -264,6 +268,7 @@ DEPENDENCIES:
- flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`)
- flutter_secure_storage_darwin (from `.symlinks/plugins/flutter_secure_storage_darwin/darwin`)
- flutter_tts (from `.symlinks/plugins/flutter_tts/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`)
@@ -322,6 +327,7 @@ SPEC REPOS:
- StripePaymentsUI
- StripeUICore
- TOCropViewController
+ - WebRTC-SDK
EXTERNAL SOURCES:
app_links:
@@ -350,6 +356,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/flutter_secure_storage_darwin/darwin"
flutter_tts:
:path: ".symlinks/plugins/flutter_tts/ios"
+ flutter_webrtc:
+ :path: ".symlinks/plugins/flutter_webrtc/ios"
geolocator_apple:
:path: ".symlinks/plugins/geolocator_apple/darwin"
google_sign_in_ios:
@@ -424,6 +432,7 @@ SPEC CHECKSUMS:
flutter_local_notifications: a5a732f069baa862e728d839dd2ebb904737effb
flutter_secure_storage_darwin: acdb3f316ed05a3e68f856e0353b133eec373a23
flutter_tts: 35ac3c7d42412733e795ea96ad2d7e05d0a75113
+ flutter_webrtc: ec91d94b484ad49cf191ef93413f64a40ffd3b4c
geolocator_apple: ab36aa0e8b7d7a2d7639b3b4e48308394e8cef5e
google_sign_in_ios: 000870aa06da9b28d1d0bf7ef70ff0213059dd28
GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7
@@ -467,8 +476,9 @@ SPEC CHECKSUMS:
vibration: ca8104a8875b9c493e15b21b04e456befd0ff6eb
video_player_avfoundation: dd410b52df6d2466a42d28550e33e4146928280a
wakelock_plus: e29112ab3ef0b318e58cfa5c32326458be66b556
+ WebRTC-SDK: ab9b5319e458c2bfebdc92b3600740da35d5630d
webview_flutter_wkwebview: 8ebf4fded22593026f7dbff1fbff31ea98573c8d
-PODFILE CHECKSUM: 8a0b04ec79a0d49122ae6c10242e7cb023122802
+PODFILE CHECKSUM: 2ba2e4898a3d9a1615dafa81db0705bd67da92c3
COCOAPODS: 1.16.2
diff --git a/lib/app_bindings.dart b/lib/app_bindings.dart
index 733fd35..ce6a2c0 100644
--- a/lib/app_bindings.dart
+++ b/lib/app_bindings.dart
@@ -5,6 +5,17 @@ import 'package:Intaleq/controller/firebase/local_notification.dart';
import 'package:Intaleq/controller/home/deep_link_controller.dart';
import 'package:Intaleq/controller/local/local_controller.dart';
import 'package:Intaleq/controller/functions/tts.dart';
+import 'package:Intaleq/controller/voice_call_controller.dart';
+
+import 'package:Intaleq/controller/home/map/map_socket_controller.dart';
+import 'package:Intaleq/controller/home/map/map_engine_controller.dart';
+import 'package:Intaleq/controller/home/map/location_search_controller.dart';
+import 'package:Intaleq/controller/home/map/nearby_drivers_controller.dart';
+import 'package:Intaleq/controller/home/map/ride_lifecycle_controller.dart';
+import 'package:Intaleq/controller/home/map/ui_interactions_controller.dart';
+import 'package:Intaleq/controller/home/menu_controller.dart';
+import 'package:Intaleq/controller/functions/crud.dart';
+import 'package:Intaleq/controller/home/points_for_rider_controller.dart';
/// This is the central dependency injection file for the app.
/// It uses GetX Bindings to make the app start faster and manage memory better.
@@ -39,5 +50,19 @@ class AppBindings extends Bindings {
// TextToSpeechController for global accessibility
Get.lazyPut(() => TextToSpeechController(), fenix: true);
+
+ // VoiceCallController for WebRTC calls
+ Get.lazyPut(() => VoiceCallController(), fenix: true);
+
+ // Map & Ride controllers registered globally to prevent route-disposal race conditions.
+ Get.put(MapSocketController(), permanent: true);
+ Get.put(MapEngineController(), permanent: true);
+ Get.put(LocationSearchController(), permanent: true);
+ Get.put(NearbyDriversController(), permanent: true);
+ Get.put(RideLifecycleController(), permanent: true);
+ Get.put(UiInteractionsController(), permanent: true);
+ Get.put(MyMenuController(), permanent: true);
+ Get.put(CRUD(), permanent: true);
+ Get.put(WayPointController(), permanent: true);
}
}
diff --git a/lib/constant/links.dart b/lib/constant/links.dart
index bf9601c..146bd33 100644
--- a/lib/constant/links.dart
+++ b/lib/constant/links.dart
@@ -231,6 +231,7 @@ class AppLink {
static String addMishwari = "$server/ride/mishwari/add.php";
static String cancelMishwari = "$server/ride/mishwari/cancel.php";
static String getMishwari = "$server/ride/mishwari/get.php";
+ static String sendChatMessage = "$server/ride/chat/send_message.php";
//-----------------DriverOrder------------------
diff --git a/lib/controller/auth/otp_controller.dart b/lib/controller/auth/otp_controller.dart
index d3cf572..5fe1150 100644
--- a/lib/controller/auth/otp_controller.dart
+++ b/lib/controller/auth/otp_controller.dart
@@ -107,13 +107,14 @@ class PhoneAuthHelper {
/// Verifies the OTP and logs the user in.
- static Future verifyOtp(String phoneNumber) async {
+ static Future verifyOtp(String phoneNumber, String otpCode) async {
try {
final fixedPhone = formatSyrianPhone(phoneNumber);
final response = await CRUD().post(
link: _verifyOtpUrl,
payload: {
'phone_number': fixedPhone,
+ 'otp': otpCode,
},
);
diff --git a/lib/controller/firebase/firbase_messge.dart b/lib/controller/firebase/firbase_messge.dart
index e942fd1..47ab261 100644
--- a/lib/controller/firebase/firbase_messge.dart
+++ b/lib/controller/firebase/firbase_messge.dart
@@ -16,8 +16,9 @@ import '../../views/Rate/rate_captain.dart';
import '../../views/home/map_page_passenger.dart';
import '../../views/home/profile/promos_passenger_page.dart';
import '../auth/google_sign.dart';
-import '../functions/audio_record1.dart';
-import '../home/map_passenger_controller.dart';
+import 'package:Intaleq/controller/voice_call_controller.dart';
+import '../home/map/ride_lifecycle_controller.dart';
+import '../home/map/ride_state.dart';
import 'local_notification.dart';
class FirebaseMessagesController extends GetxController {
@@ -105,8 +106,8 @@ class FirebaseMessagesController extends GetxController {
// اقرأ "النوع" من حمولة البيانات، وليس من العنوان
String category = message.data['category'] ?? '';
- final mapCtrl = Get.isRegistered()
- ? Get.find()
+ final mapCtrl = Get.isRegistered()
+ ? Get.find()
: null;
// اقرأ العنوان (للعرض)
String title = message.data['title'] ?? message.notification?.title ?? '';
@@ -167,8 +168,8 @@ class FirebaseMessagesController extends GetxController {
GoogleSignInHelper.signOut();
} else if (category == 'Driver Is Going To Passenger') {
// <-- كان 'Driver Is Going To Passenger'
- Get.find().isDriverInPassengerWay = true;
- Get.find().update();
+ Get.find().isDriverInPassengerWay = true;
+ Get.find().update();
if (Platform.isAndroid) {
notificationController.showNotification(title, body, 'tone1');
}
@@ -214,7 +215,7 @@ class FirebaseMessagesController extends GetxController {
}
if (driverList.isNotEmpty) {
- Get.find()
+ Get.find()
.processRideFinished(driverList, source: "FCM");
}
} else if (category == 'Finish Monitor') {
@@ -232,9 +233,9 @@ class FirebaseMessagesController extends GetxController {
Log.print("🔔 FCM: Ride Cancelled by Driver received.");
// لا داعي لكتابة منطق التنظيف هنا، الكنترولر يتكفل بكل شيء
- if (Get.isRegistered()) {
+ if (Get.isRegistered()) {
// استدعاء الحارس (سيتجاهل الأمر إذا كان السوكيت قد سبقه)
- Get.find()
+ Get.find()
.processRideCancelledByDriver(message.data, source: "FCM");
}
@@ -247,6 +248,19 @@ class FirebaseMessagesController extends GetxController {
// ... (باقي الحالات مثل Call Income, Call End, إلخ) ...
// ... بنفس الطريقة ...
+ else if (category == 'incoming_call') {
+ final sessionId = message.data['session_id'];
+ final callerName = message.data['caller_name'];
+ final rideId = message.data['ride_id'];
+ if (sessionId != null && callerName != null && rideId != null) {
+ Get.find().receiveCall(
+ sessionIdVal: sessionId.toString(),
+ remoteNameVal: callerName.toString(),
+ rideIdVal: rideId.toString(),
+ );
+ }
+ }
+
else if (category == 'Order Applied') {
if (Platform.isAndroid) {
notificationController.showNotification(
@@ -277,7 +291,7 @@ class FirebaseMessagesController extends GetxController {
// var myList = jsonDecode(driverListJson) as List;
// Log.print('myList: ${myList}');
- // final controller = Get.find();
+ // final controller = Get.find();
// // استدعاء الدالة الموحدة الجديدة التي أنشأناها
// await controller.processRideAcceptance(
@@ -311,8 +325,8 @@ class FirebaseMessagesController extends GetxController {
// }
// GoogleSignInHelper.signOut();
// } else if (message.notification!.title! == 'Driver Is Going To Passenger') {
- // Get.find().isDriverInPassengerWay = true;
- // Get.find().update();
+ // Get.find().isDriverInPassengerWay = true;
+ // Get.find().update();
// if (Platform.isAndroid) {
// notificationController.showNotification('Driver is Going To You'.tr,
// 'Please stay on the picked point.'.tr, 'tone1');
@@ -341,13 +355,13 @@ class FirebaseMessagesController extends GetxController {
// // (تم حذف الإشعار المحلي من هنا، نُقل إلى الدالة الموحدة)
- // final controller = Get.find();
+ // final controller = Get.find();
// // استدعاء حارس البوابة الجديد والآمن
// controller.processRideBegin();
// // (تم حذف كل الأوامر التالية من هنا)
- // // Get.find().getBeginRideFromDriver();
+ // // Get.find().getBeginRideFromDriver();
// // box.write(BoxName.passengerWalletTotal, '0');
// // update();
// } else if (message.notification!.title! == 'Hi ,I will go now'.tr) {
@@ -360,7 +374,7 @@ class FirebaseMessagesController extends GetxController {
// update();
// } // ... داخل معالج الإشعارات (FCM Handler) ...
// if (message.notification!.title! == 'Hi ,I Arrive your site'.tr) {
- // final controller = Get.find();
+ // final controller = Get.find();
// // 1. التأكد أننا في الحالة الصحيحة (السائق كان في الطريق)
// if (controller.currentRideState.value == RideState.driverApplied) {
@@ -383,7 +397,7 @@ class FirebaseMessagesController extends GetxController {
// title: 'Ok'.tr,
// onPressed: () async {
// Get.back();
- // await Get.find()
+ // await Get.find()
// .reSearchAfterCanceledFromDriver();
// },
// ),
@@ -394,7 +408,7 @@ class FirebaseMessagesController extends GetxController {
// Get.offAll(() => const MapPagePassenger());
// },
// )
- // // Get.find()
+ // // Get.find()
// // .searchNewDriverAfterRejectingFromDriver();
// );
// } else if (message.notification!.title! == 'Driver Finish Trip'.tr) {
@@ -434,7 +448,7 @@ class FirebaseMessagesController extends GetxController {
// box.write(BoxName.passengerWalletTotal, 0);
// }
- // Get.find().tripFinishedFromDriver();
+ // Get.find().tripFinishedFromDriver();
// NotificationController().showNotification(
// 'Don’t forget your personal belongings.'.tr,
@@ -535,7 +549,7 @@ class FirebaseMessagesController extends GetxController {
// box.write(BoxName.parentTripSelected, false);
// box.remove(BoxName.tokenParent);
- // Get.find().restCounter();
+ // Get.find().restCounter();
// Get.offAll(() => const MapPagePassenger());
// }
// // else if (message.notification!.title! == 'Order Applied') {
@@ -595,8 +609,8 @@ class FirebaseMessagesController extends GetxController {
// Get.find().sendNotificationToPassengerToken(
// 'Hi ,I will go now'.tr,
// 'I will go now'.tr,
- // Get.find().driverToken, []);
- // Get.find()
+ // Get.find().driverToken, []);
+ // Get.find()
// .startTimerDriverWaitPassenger5Minute();
Get.back();
@@ -639,12 +653,12 @@ class DriverTipWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
- return GetBuilder(builder: (controller) {
+ return GetBuilder(builder: (controller) {
return Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
// Text(
- // '${'Your fee is '.tr}${Get.find().totalPassenger.toStringAsFixed(2)}'),
+ // '${'Your fee is '.tr}${Get.find().totalPassenger.toStringAsFixed(2)}'),
Text(
'Do you want to pay Tips for this Driver'.tr,
textAlign: TextAlign.center,
diff --git a/lib/controller/functions/audio_record1.dart b/lib/controller/functions/audio_record1.dart
index 095b8c8..8042cbc 100644
--- a/lib/controller/functions/audio_record1.dart
+++ b/lib/controller/functions/audio_record1.dart
@@ -30,7 +30,7 @@ class AudioRecorderController extends GetxController {
}
// Start recording
- Future startRecording() async {
+ Future startRecording({String? rideId}) async {
final bool isPermissionGranted = await recorder.hasPermission();
if (!isPermissionGranted) {
// RecordingPermissionException('l');
@@ -38,10 +38,12 @@ class AudioRecorderController extends GetxController {
}
final directory = await getApplicationDocumentsDirectory();
+ final String dateStr =
+ '${DateTime.now().year}-${DateTime.now().month.toString().padLeft(2, '0')}-${DateTime.now().day.toString().padLeft(2, '0')}';
// Generate a unique file name using the current timestamp
- String fileName =
- // '${DateTime.now().year}-${DateTime.now().month}-${DateTime.now().day}_${Get.find().rideId}.m4a';
- '${DateTime.now().year}-${DateTime.now().month}-${DateTime.now().day}.m4a';
+ String fileName = (rideId != null && rideId.isNotEmpty && rideId != 'yet' && rideId != 'null')
+ ? '${dateStr}_$rideId.m4a'
+ : '$dateStr.m4a';
filePath = '${directory.path}/$fileName';
// Define the configuration for the recording
diff --git a/lib/controller/functions/log_out.dart b/lib/controller/functions/log_out.dart
index c0aa3cb..a8ae759 100644
--- a/lib/controller/functions/log_out.dart
+++ b/lib/controller/functions/log_out.dart
@@ -12,6 +12,14 @@ import 'package:Intaleq/views/widgets/elevated_btn.dart';
import 'package:Intaleq/views/widgets/my_textField.dart';
import '../../constant/style.dart';
+import 'package:Intaleq/controller/home/map/map_socket_controller.dart';
+import 'package:Intaleq/controller/home/map/map_engine_controller.dart';
+import 'package:Intaleq/controller/home/map/location_search_controller.dart';
+import 'package:Intaleq/controller/home/map/nearby_drivers_controller.dart';
+import 'package:Intaleq/controller/home/map/ride_lifecycle_controller.dart';
+import 'package:Intaleq/controller/home/map/ui_interactions_controller.dart';
+import 'package:Intaleq/controller/home/menu_controller.dart';
+import 'package:Intaleq/controller/home/points_for_rider_controller.dart';
class LogOutController extends GetxController {
TextEditingController checkTxtController = TextEditingController();
@@ -110,6 +118,15 @@ class LogOutController extends GetxController {
box.remove(BoxName.accountIdStripeConnect);
box.remove(BoxName.passengerWalletTotal);
box.remove(BoxName.isVerified);
+ Get.delete(force: true);
+ Get.delete(force: true);
+ Get.delete(force: true);
+ Get.delete(force: true);
+ Get.delete(force: true);
+ Get.delete(force: true);
+ Get.delete(force: true);
+ Get.delete(force: true);
+ Get.delete(force: true);
Get.offAll(OnBoardingPage());
},
child: Text(
diff --git a/lib/controller/functions/upload_image.dart b/lib/controller/functions/upload_image.dart
index a3bfdcd..80f5b82 100644
--- a/lib/controller/functions/upload_image.dart
+++ b/lib/controller/functions/upload_image.dart
@@ -76,9 +76,11 @@ class ImageController extends GetxController {
length,
filename: basename(file.path),
);
+ final String fingerPrint = box.read(BoxName.deviceFpEncrypted)?.toString() ?? '';
request.headers.addAll({
'Authorization':
- 'Bearer ${X.r(X.r(X.r(box.read(BoxName.jwt), cn), cC), cs).toString().split(AppInformation.addd)[0]}'
+ 'Bearer ${X.r(X.r(X.r(box.read(BoxName.jwt), cn), cC), cs).toString().split(AppInformation.addd)[0]}',
+ 'X-Device-FP': fingerPrint,
});
// Set the file name to the driverID
request.files.add(
diff --git a/lib/controller/home/compare.sh b/lib/controller/home/compare.sh
new file mode 100644
index 0000000..02ae383
--- /dev/null
+++ b/lib/controller/home/compare.sh
@@ -0,0 +1,89 @@
+#!/bin/bash
+
+ORIG_FILE="lib/controller/home/map_passenger_controller.dart"
+ALL_FILES="lib/controller/home/map/location_search_controller.dart lib/controller/home/map/map_engine_controller.dart lib/controller/home/map/map_screen_binding.dart lib/controller/home/map/map_socket_controller.dart lib/controller/home/map/nearby_drivers_controller.dart lib/controller/home/map/ride_lifecycle_controller.dart lib/controller/home/map/ui_interactions_controller.dart"
+
+echo "Extracting methods from original controller..."
+# Methods typically start with spaces and have patterns like:
+# returnType methodName( or methodName(
+# Let's extract words that precede ( on lines that don't start with keywords (if, for, while, switch, catch, etc.)
+# We will use awk to parse.
+METHODS=$(cat "$ORIG_FILE" | awk '
+# Skip single-line comments
+/\/\// { next }
+# Skip imports and class declarations
+/import/ || /class/ { next }
+# Find lines with "("
+/\(/ {
+ # Replace anything inside parentheses and curly braces to simplify
+ gsub(/\(.*\)/, "()")
+ # Find word before "()"
+ for (i = 1; i <= NF; i++) {
+ if ($i ~ /[a-zA-Z0-9_]+\(\)/) {
+ name = $i
+ sub(/\(\)/, "", name)
+ # Remove any leading modifiers like async, Future, static, etc.
+ # Only keep valid identifiers that are not control keywords
+ if (name !~ /^(if|for|while|switch|catch|super|await|print|assert|dynamic|void|return|with|override|get|set|else|try|final|const|var|late|static|factory|new|abstract|covariant|external|operator|part|required|typedef|yield)$/ && name ~ /^[a-zA-Z_][a-zA-Z0-9_]*$/) {
+ print name
+ }
+ }
+ }
+}' | sort -u)
+
+echo "Extracting fields/variables from original controller..."
+# Fields are usually declared inside the class at the beginning of lines or indented.
+# e.g., RxBool isSearching = false.obs; or String? rideId;
+VARS=$(cat "$ORIG_FILE" | awk '
+/\/\// { next }
+/import/ || /class/ { next }
+# Lines ending with ";" or containing "=" followed by ";"
+/;/ {
+ # Extract words that look like declarations.
+ # We look for typical type names or var/final followed by variable name
+ for (i = 1; i < NF; i++) {
+ if ($i ~ /^(var|final|const|late|RxBool|RxInt|RxDouble|RxString|RxList|RxMap|RxSet|Rx|String|int|double|bool|List|Map|Set|Timer|LatLng|Position|IntaleqMapController)$/) {
+ # The next field might be the variable name, or it might have a type like String?
+ name = $(i+1)
+ # Remove trailing ?, ;, =
+ sub(/\?/, "", name)
+ sub(/;/, "", name)
+ sub(/=/, "", name)
+ if (name ~ /^[a-zA-Z_][a-zA-Z0-9_]*$/) {
+ print name
+ }
+ }
+ }
+}' | sort -u)
+
+echo "Checking split files for methods..."
+echo "--- MISSING METHODS ---"
+MISSING_METHODS_COUNT=0
+# Create a temporary file with all split contents to search efficiently
+cat $ALL_FILES > lib/controller/home/temp_split_combined.txt
+
+for method in $METHODS; do
+ # Search for this method name as a whole word in split controllers
+ FOUND=$(grep -w "$method" lib/controller/home/temp_split_combined.txt 2>/dev/null)
+ if [ -z "$FOUND" ]; then
+ echo " - $method"
+ MISSING_METHODS_COUNT=$((MISSING_METHODS_COUNT+1))
+ fi
+done
+echo "Total missing methods: $MISSING_METHODS_COUNT"
+
+echo ""
+echo "Checking split files for variables/fields..."
+echo "--- MISSING VARIABLES ---"
+MISSING_VARS_COUNT=0
+for var in $VARS; do
+ FOUND=$(grep -w "$var" lib/controller/home/temp_split_combined.txt 2>/dev/null)
+ if [ -z "$FOUND" ]; then
+ echo " - $var"
+ MISSING_VARS_COUNT=$((MISSING_VARS_COUNT+1))
+ fi
+done
+echo "Total missing variables: $MISSING_VARS_COUNT"
+
+# Clean up temp file
+rm lib/controller/home/temp_split_combined.txt
diff --git a/lib/controller/home/compare_precise.py b/lib/controller/home/compare_precise.py
new file mode 100644
index 0000000..57ba26c
--- /dev/null
+++ b/lib/controller/home/compare_precise.py
@@ -0,0 +1,104 @@
+import sys
+import re
+
+def parse_stream(stream_text):
+ # Splits the stream by our custom file delimiters
+ files = {}
+ parts = re.split(r'=== FILE: (.*?) ===\n', stream_text)
+
+ # The first part is the original monolithic file
+ if parts:
+ files['original'] = parts[0]
+
+ for i in range(1, len(parts), 2):
+ filename = parts[i]
+ content = parts[i+1] if i+1 < len(parts) else ""
+ files[filename] = content
+
+ return files
+
+def strip_comments(text):
+ text = re.sub(r'/\*.*?\*/', '', text, flags=re.DOTALL)
+ text = re.sub(r'//.*', '', text)
+ return text
+
+def extract_declarations(text):
+ clean = strip_comments(text)
+
+ # Matches method/function declarations inside a class in Dart
+ # e.g., void myMethod(..., Future myMethod(..., myMethod(..., get myProp, set myProp
+ # We look for word followed by ( or get/set followed by word.
+ method_decl_pattern = re.compile(
+ r'(?:[a-zA-Z0-9_<>\?\[\]]+(?:\s+[a-zA-Z0-9_<>\?\[\]]+)*\s+)?([a-zA-Z0-9_]+)\s*\([^\)]*\)\s*(?:async)?\s*(?:=>|\{)'
+ )
+
+ methods = set()
+ for match in method_decl_pattern.finditer(clean):
+ method_name = match.group(1)
+ if method_name not in keywords and not method_name.isdigit():
+ methods.add(method_name)
+
+ # Also extract getters and setters
+ getset_pattern = re.compile(r'\b(?:get|set)\s+([a-zA-Z0-9_]+)\b')
+ for match in getset_pattern.finditer(clean):
+ name = match.group(1)
+ if name not in keywords:
+ methods.add(name)
+
+ # Extract variables/fields declarations
+ var_decl_pattern = re.compile(
+ r'\b(?:var|final|const|late|RxBool|RxInt|RxDouble|RxString|RxList|RxMap|RxSet|Rx|String|int|double|bool|List|Map|Set|Timer|LatLng|Position|IntaleqMapController)\??\s+([a-zA-Z0-9_]+)\b'
+ )
+
+ variables = set()
+ for match in var_decl_pattern.finditer(clean):
+ var_name = match.group(1)
+ if var_name not in keywords and not var_name.isdigit():
+ variables.add(var_name)
+
+ return methods, variables
+
+keywords = {
+ 'if', 'for', 'while', 'switch', 'catch', 'super', 'await', 'print',
+ 'assert', 'dynamic', 'void', 'return', 'with', 'override', 'get', 'set',
+ 'class', 'import', 'extends', 'implements', 'mixin', 'this', 'else', 'try',
+ 'final', 'const', 'var', 'late', 'static', 'factory', 'new', 'abstract',
+ 'covariant', 'external', 'operator', 'part', 'required', 'typedef', 'yield'
+}
+
+def main():
+ stream_text = sys.stdin.read()
+ files = parse_stream(stream_text)
+
+ orig_content = files.get('original', '')
+ split_contents = {k: v for k, v in files.items() if k != 'original'}
+
+ orig_methods, orig_vars = extract_declarations(orig_content)
+
+ # Combined declarations in split files
+ split_methods = set()
+ split_vars = set()
+ for filename, content in split_contents.items():
+ m, v = extract_declarations(content)
+ split_methods.update(m)
+ split_vars.update(v)
+
+ missing_methods = sorted(orig_methods - split_methods)
+ missing_vars = sorted(orig_vars - split_vars)
+
+ print("--- PRECISE MISSING METHODS ---")
+ print(f"Total original methods/getters/setters: {len(orig_methods)}")
+ print(f"Total defined in split controllers: {len(split_methods)}")
+ print(f"Total missing: {len(missing_methods)}")
+ for m in missing_methods:
+ print(f" - {m}")
+
+ print("\n--- PRECISE MISSING VARIABLES/FIELDS ---")
+ print(f"Total original variables: {len(orig_vars)}")
+ print(f"Total defined in split controllers: {len(split_vars)}")
+ print(f"Total missing: {len(missing_vars)}")
+ for v in missing_vars:
+ print(f" - {v}")
+
+if __name__ == '__main__':
+ main()
diff --git a/lib/controller/home/comparison_results.txt b/lib/controller/home/comparison_results.txt
new file mode 100644
index 0000000..f554094
--- /dev/null
+++ b/lib/controller/home/comparison_results.txt
@@ -0,0 +1,103 @@
+Extracting methods from original controller...
+Extracting fields/variables from original controller...
+Checking split files for methods...
+--- MISSING METHODS ---
+ - _applyLowEndModeIfNeeded
+ - _buildOsrmWaypointCoords
+ - _calculateDistance
+ - _checkAndRecalculateIfDeviated
+ - _fillDriverDataLocally
+ - _haversineKm
+ - _initMinimalIcons
+ - _initializePolygons
+ - _isActiveRideState
+ - _kmToLatDelta
+ - _kmToLngDelta
+ - _onDriverArrivedWithSocket
+ - _onRideCancelledWithSocket
+ - _onRideStartedWithSocket
+ - _relevanceScore
+ - _restorePolyline
+ - _stageNiceToHave
+ - _stagePricingAndState
+ - _startMasterTimer
+ - _startMasterTimerWithInterval
+ - _startPollingFallback
+ - _stopDriverLocationPolling
+ - _updateDriverMarker
+ - cancelRide
+ - detectPerfMode
+ - getAIKey
+ - getMapPointsForAllMethods
+ - getPassengerLocationUniversity
+ - handleActiveRideOnStartup
+ - isDriversDataValid
+ - onChangedPassengerCount
+ - onChangedPassengersChoose
+ - showDrawingBottomSheet
+ - showNoDriversDialog
+ - startSearchingTimer
+Total missing methods: 35
+
+Checking split files for variables/fields...
+--- MISSING VARIABLES ---
+ - _isStateProcessing
+ - _isUsingFallback
+ - _maxReconnectAttempts
+ - apiDistanceMeters
+ - c
+ - carInfo
+ - carsOrder
+ - coordDestination
+ - currentCarType
+ - currentDriverLocation
+ - currentLocationOfDrivers
+ - currentRideId
+ - currentTimeSearchingCaptainWindow
+ - dInfo
+ - dLat
+ - datadriverCarsLocationToPassengerAfterApplied
+ - distanceOfTrip
+ - driverCarPlate
+ - driverLocationToPassenger
+ - driverOrderStatus
+ - durationByPassenger
+ - endLocation
+ - fName
+ - finalReason
+ - headingList
+ - increaseFeeFormKey
+ - isDriversTokensSend
+ - isFirstWaypoint
+ - isInUniversity
+ - isSaaSRequest
+ - kmInDegree
+ - lName
+ - latDest
+ - latestPosition
+ - lngDest
+ - lowPerf
+ - messagesFormKey
+ - originCoords
+ - pLower
+ - passengerLocationStringUnvirsity
+ - previousLocationOfDrivers
+ - progressTimerRideBeginVip
+ - qLower
+ - rLat1
+ - rLat2
+ - ram
+ - rideData
+ - sdk
+ - selectedPassengerCount
+ - startLng
+ - startLocation
+ - stringElapsedTimeRideBegin
+ - tax
+ - totalPassengerBalashDiscount
+ - totalPassengerComfortDiscount
+ - totalPassengerElectricDiscount
+ - totalPassengerLadyDiscount
+ - totalPassengerRaihGaiDiscount
+ - totalPassengerSpeedDiscount
+Total missing variables: 59
diff --git a/lib/controller/home/map/car_location.dart b/lib/controller/home/map/car_location.dart
new file mode 100644
index 0000000..2c3ca3b
--- /dev/null
+++ b/lib/controller/home/map/car_location.dart
@@ -0,0 +1,15 @@
+class CarLocation {
+ final String id;
+ final double latitude;
+ final double longitude;
+ final double distance;
+ final double duration;
+
+ CarLocation({
+ required this.id,
+ required this.latitude,
+ required this.longitude,
+ this.distance = 10000,
+ this.duration = 10000,
+ });
+}
diff --git a/lib/controller/home/map/location_search_controller.dart b/lib/controller/home/map/location_search_controller.dart
new file mode 100644
index 0000000..ff14928
--- /dev/null
+++ b/lib/controller/home/map/location_search_controller.dart
@@ -0,0 +1,1052 @@
+import 'dart:async';
+import 'dart:convert';
+import 'dart:io';
+import 'dart:math' show cos, pi, max, min, atan2, sin, sqrt;
+import 'package:flutter/material.dart';
+import 'package:flutter/services.dart';
+import 'package:geolocator/geolocator.dart';
+import 'package:get/get.dart';
+import 'package:intaleq_maps/intaleq_maps.dart';
+import 'package:location/location.dart';
+import 'package:http/http.dart' as http;
+
+import '../../../constant/box_name.dart';
+import '../../../constant/links.dart';
+import '../../../constant/colors.dart';
+import '../../../constant/style.dart';
+import '../../../constant/table_names.dart';
+import '../../../main.dart'; // contains global 'box', 'sql'
+import '../../../print.dart';
+import '../../../services/offline_map_service.dart';
+import '../../functions/crud.dart';
+import '../points_for_rider_controller.dart';
+import '../../../views/home/map_widget.dart/form_serch_multiy_point.dart';
+import '../../../views/widgets/error_snakbar.dart';
+import 'map_engine_controller.dart';
+import '../deep_link_controller.dart';
+import 'ride_lifecycle_controller.dart';
+import 'ride_state.dart';
+import '../../../constant/country_polygons.dart';
+import '../../../constant/univeries_polygon.dart';
+
+class LocationSearchController extends GetxController {
+ List