إضافة الهوية الجديدة Tripz
This commit is contained in:
@@ -319,7 +319,8 @@ class LocationSearchController extends GetxController {
|
||||
rideLifecycle.resetNoRideSearch();
|
||||
}
|
||||
|
||||
Log.print('LocationSearchController: Reverse geocoding deferred — will run when map is idle.');
|
||||
Log.print(
|
||||
'LocationSearchController: Reverse geocoding deferred — will run when map is idle.');
|
||||
|
||||
OfflineMapService.instance
|
||||
.downloadRegion(passengerLocation, radiusKm: 10.0);
|
||||
@@ -506,11 +507,13 @@ class LocationSearchController extends GetxController {
|
||||
target.longitude,
|
||||
);
|
||||
if (distanceDelta < 20.0) {
|
||||
Log.print('📍 updateCurrentLocationFromCamera: Skipped (المسافة ${distanceDelta.toStringAsFixed(1)}م < 20م)');
|
||||
Log.print(
|
||||
'📍 updateCurrentLocationFromCamera: Skipped (المسافة ${distanceDelta.toStringAsFixed(1)}م < 20م)');
|
||||
return;
|
||||
}
|
||||
|
||||
Log.print('📍 updateCurrentLocationFromCamera: $target (تغيير ${distanceDelta.toStringAsFixed(1)}م)');
|
||||
Log.print(
|
||||
'📍 updateCurrentLocationFromCamera: $target (تغيير ${distanceDelta.toStringAsFixed(1)}م)');
|
||||
newMyLocation = target;
|
||||
|
||||
if (_pendingGeocode) {
|
||||
@@ -559,7 +562,8 @@ class LocationSearchController extends GetxController {
|
||||
);
|
||||
if (distanceDelta < 20.0) return;
|
||||
|
||||
Log.print('📸 onCameraMoveThrottled: ${pos.target} (تغيير ${distanceDelta.toStringAsFixed(1)}م)');
|
||||
Log.print(
|
||||
'📸 onCameraMoveThrottled: ${pos.target} (تغيير ${distanceDelta.toStringAsFixed(1)}م)');
|
||||
int waypointsLength = Get.find<WayPointController>().wayPoints.length;
|
||||
int index = wayPointIndex;
|
||||
if (waypointsLength > 0 && index < placesCoordinate.length) {
|
||||
@@ -900,7 +904,8 @@ class LocationSearchController extends GetxController {
|
||||
mapEngine.heightBottomSheetShown = 250;
|
||||
update();
|
||||
|
||||
mySnackbarInfo('Route and prices have been calculated successfully!'.tr);
|
||||
mySnackbarInfo(
|
||||
'Route and prices have been calculated successfully!'.tr);
|
||||
}
|
||||
} else {
|
||||
Log.print('⚠️ Could not extract valid coordinates from link: $link');
|
||||
|
||||
@@ -2,7 +2,7 @@ import 'dart:async';
|
||||
import 'dart:ui' as ui;
|
||||
import 'dart:math' show cos, max, min, pi, pow, sqrt;
|
||||
import 'dart:typed_data';
|
||||
import 'package:siro_rider/controller/home/map/ride_lifecycle_controller.dart';
|
||||
import 'package:tripz_rider/controller/home/map/ride_lifecycle_controller.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
@@ -93,7 +93,7 @@ class MapEngineController extends GetxController {
|
||||
}
|
||||
|
||||
Future<void> onStyleLoaded() async {
|
||||
Log.print('🗺️ Siro Map Style Loaded. Initializing...');
|
||||
Log.print('🗺️ Tripz Map Style Loaded. Initializing...');
|
||||
isStyleLoaded = true;
|
||||
await _loadMapIcons();
|
||||
|
||||
|
||||
@@ -118,7 +118,8 @@ class MapSocketController extends GetxController {
|
||||
Log.print("📡 Re-subscribed to driver location after connect");
|
||||
}
|
||||
if (_subscribedTransitRouteId != null) {
|
||||
socket.emit('subscribe_transit_route', {'route_id': _subscribedTransitRouteId});
|
||||
socket.emit(
|
||||
'subscribe_transit_route', {'route_id': _subscribedTransitRouteId});
|
||||
Log.print("🚌 Re-subscribed to transit route after connect");
|
||||
}
|
||||
update();
|
||||
@@ -150,7 +151,8 @@ class MapSocketController extends GetxController {
|
||||
Log.print("📡 Re-subscribed to driver location after reconnect");
|
||||
}
|
||||
if (_subscribedTransitRouteId != null) {
|
||||
socket.emit('subscribe_transit_route', {'route_id': _subscribedTransitRouteId});
|
||||
socket.emit(
|
||||
'subscribe_transit_route', {'route_id': _subscribedTransitRouteId});
|
||||
Log.print("🚌 Re-subscribed to transit route after reconnect");
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,8 @@ class NearbyDriversController extends GetxController {
|
||||
carsLocationByPassenger = [];
|
||||
final locSearch = Get.find<LocationSearchController>();
|
||||
|
||||
if (locSearch.passengerLocation.latitude == 0 && locSearch.passengerLocation.longitude == 0) {
|
||||
if (locSearch.passengerLocation.latitude == 0 &&
|
||||
locSearch.passengerLocation.longitude == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -85,7 +86,8 @@ class NearbyDriversController extends GetxController {
|
||||
|
||||
if (lat == 0.0 || lng == 0.0) continue;
|
||||
|
||||
String driverId = (carData['driver_id'] ?? carData['id'] ?? '').toString();
|
||||
String driverId =
|
||||
(carData['driver_id'] ?? carData['id'] ?? '').toString();
|
||||
if (driverId.isEmpty || driverId == 'null') continue;
|
||||
|
||||
_updateOrCreateMarker(
|
||||
@@ -334,7 +336,8 @@ class NearbyDriversController extends GetxController {
|
||||
String markerId, LatLng newPosition, double newHeading, String icon) {
|
||||
final mapEngine = Get.find<MapEngineController>();
|
||||
if (!mapEngine.isIconsLoaded) {
|
||||
Log.print("⚠️ Skipping drawing marker $markerId because map icons are not fully loaded yet.");
|
||||
Log.print(
|
||||
"⚠️ Skipping drawing marker $markerId because map icons are not fully loaded yet.");
|
||||
return;
|
||||
}
|
||||
final mId = MarkerId(markerId);
|
||||
@@ -407,7 +410,8 @@ class NearbyDriversController extends GetxController {
|
||||
};
|
||||
|
||||
if (mapEngine.mapController != null) {
|
||||
mapEngine.mapController!.animateCamera(CameraUpdate.newLatLng(currentPos));
|
||||
mapEngine.mapController!
|
||||
.animateCamera(CameraUpdate.newLatLng(currentPos));
|
||||
}
|
||||
|
||||
mapEngine.update();
|
||||
|
||||
@@ -70,7 +70,7 @@ class RideLifecycleController extends GetxController {
|
||||
bool isWhatsAppOrder = false;
|
||||
LatLng startLocation = const LatLng(32, 35);
|
||||
LatLng endLocation = const LatLng(32, 35);
|
||||
String dynamicApiUrl = 'https://routec.intaleq.xyz/route';
|
||||
String dynamicApiUrl = 'https://routec.tripz.xyz/route';
|
||||
String? cardNumber;
|
||||
bool isBeginRideFromDriverRunning = false;
|
||||
bool isDriversTokensSend = false;
|
||||
@@ -1665,7 +1665,7 @@ class RideLifecycleController extends GetxController {
|
||||
|
||||
Future<void> getInitialDriverDistanceAndDuration(
|
||||
LatLng driverPos, LatLng passengerPos) async {
|
||||
final String apiUrl = 'https://routec.intaleq.xyz/route';
|
||||
final String apiUrl = 'https://routec.tripz.xyz/route';
|
||||
final String apiKey = Env.mapKeyOsm;
|
||||
final String origin = '${driverPos.latitude},${driverPos.longitude}';
|
||||
final String dest = '${passengerPos.latitude},${passengerPos.longitude}';
|
||||
@@ -1700,7 +1700,7 @@ class RideLifecycleController extends GetxController {
|
||||
String distanceByPassenger = '';
|
||||
|
||||
Future<void> drawDriverPathOnly(LatLng driverPos, LatLng passengerPos) async {
|
||||
final String apiUrl = 'https://routec.intaleq.xyz/route';
|
||||
final String apiUrl = 'https://routec.tripz.xyz/route';
|
||||
final String apiKey = Env.mapKeyOsm;
|
||||
final String origin = '${driverPos.latitude},${driverPos.longitude}';
|
||||
final String dest = '${passengerPos.latitude},${passengerPos.longitude}';
|
||||
@@ -1888,14 +1888,14 @@ class RideLifecycleController extends GetxController {
|
||||
String generateTrackingLink(String rideId, String driverId) {
|
||||
String cleanRideId = rideId.toString().trim();
|
||||
String cleanDriverId = driverId.toString().trim();
|
||||
const String secretSalt = "Siro_Secure_Track_2025";
|
||||
const String secretSalt = "Tripz_Secure_Track_2025";
|
||||
|
||||
String rawString = "$cleanRideId$cleanDriverId$secretSalt";
|
||||
var bytes = utf8.encode(rawString);
|
||||
var digest = md5.convert(bytes);
|
||||
String token = digest.toString();
|
||||
|
||||
return "https://siromove.com/track/index.php?id=$cleanRideId&token=$token";
|
||||
return "https://tripzmove.com/track/index.php?id=$cleanRideId&token=$token";
|
||||
}
|
||||
|
||||
calcualateDistsanceInMetet(LatLng prev, current) async {
|
||||
@@ -2165,7 +2165,7 @@ class RideLifecycleController extends GetxController {
|
||||
fetchCompetitorContext();
|
||||
}
|
||||
|
||||
/// يجلب مقارنة سعر سيرو مع المنافسين ويحدّث الواجهة بشكل غير مُوقِف
|
||||
/// يجلب مقارنة سعر تريبز مع المنافسين ويحدّث الواجهة بشكل غير مُوقِف
|
||||
Future<void> fetchCompetitorContext() async {
|
||||
try {
|
||||
final String passengerLat = mapEngine.polylineCoordinates.isNotEmpty
|
||||
@@ -2182,7 +2182,7 @@ class RideLifecycleController extends GetxController {
|
||||
'passenger_lng': passengerLng,
|
||||
'distance': distance.toString(),
|
||||
'country': box.read(BoxName.countryCode) ?? '',
|
||||
'siro_price': totalPassengerSpeed,
|
||||
'tripz_price': totalPassengerSpeed,
|
||||
'car_type': 'Speed',
|
||||
},
|
||||
);
|
||||
@@ -2213,11 +2213,11 @@ class RideLifecycleController extends GetxController {
|
||||
{bool isBeginPhase = false}) async {
|
||||
if (mapController == null) {
|
||||
Log.print(
|
||||
'⚠️ mapController is null, cannot calculate route via intaleq_maps');
|
||||
'⚠️ mapController is null, cannot calculate route via tripz_maps');
|
||||
return;
|
||||
}
|
||||
|
||||
Log.print('📍 Calculating Driver Route via IntaleqMapController...');
|
||||
Log.print('📍 Calculating Driver Route via TripzMapController...');
|
||||
|
||||
try {
|
||||
final responseData =
|
||||
@@ -3754,9 +3754,8 @@ class RideLifecycleController extends GetxController {
|
||||
newMarkers.add(Marker(
|
||||
markerId: MarkerId('waypoint_$i'),
|
||||
position: wp,
|
||||
icon: InlqBitmap.fromStyleImage(isFirstWaypoint
|
||||
? 'start_icon'
|
||||
: 'end_icon'),
|
||||
icon: InlqBitmap.fromStyleImage(
|
||||
isFirstWaypoint ? 'start_icon' : 'end_icon'),
|
||||
infoWindow: InfoWindow(
|
||||
title: 'توقف ${i + 1}',
|
||||
snippet: 'stop_$i',
|
||||
@@ -4489,7 +4488,7 @@ class RideLifecycleController extends GetxController {
|
||||
}
|
||||
|
||||
/// Builds a Set of short [Polyline] segments that simulate a dashed line.
|
||||
/// intaleq_maps (MapLibre) doesn't support `patterns`, so we manually
|
||||
/// tripz_maps (MapLibre) doesn't support `patterns`, so we manually
|
||||
/// split the route into dash/gap alternating segments.
|
||||
Set<Polyline> _buildDashedPolylines({
|
||||
required List<LatLng> points,
|
||||
|
||||
@@ -20,9 +20,8 @@ class RideSimulationController extends GetxController {
|
||||
List<LatLng> _simulatedRoute = [];
|
||||
int _driverRouteIndex = 0;
|
||||
|
||||
String get simulationStatus => _isSimulating
|
||||
? 'Simulating... Step $_step'
|
||||
: 'Idle';
|
||||
String get simulationStatus =>
|
||||
_isSimulating ? 'Simulating... Step $_step' : 'Idle';
|
||||
|
||||
// آمود نقاط المسار (Jordan area: Amman center ~ 31.95, 35.91)
|
||||
static const double _centerLat = 31.95;
|
||||
@@ -35,8 +34,8 @@ class RideSimulationController extends GetxController {
|
||||
for (int i = 0; i < _routePointCount; i++) {
|
||||
double fraction = i / (_routePointCount - 1);
|
||||
double lat = _centerLat + fraction * _routeDelta;
|
||||
double lng = _centerLng + fraction * _routeDelta +
|
||||
0.005 * sin(fraction * pi * 2);
|
||||
double lng =
|
||||
_centerLng + fraction * _routeDelta + 0.005 * sin(fraction * pi * 2);
|
||||
_simulatedRoute.add(LatLng(lat, lng));
|
||||
}
|
||||
}
|
||||
@@ -151,9 +150,13 @@ class RideSimulationController extends GetxController {
|
||||
double t = exactIdx - idx;
|
||||
return LatLng(
|
||||
_simulatedRoute[idx].latitude +
|
||||
t * (_simulatedRoute[idx + 1].latitude - _simulatedRoute[idx].latitude),
|
||||
t *
|
||||
(_simulatedRoute[idx + 1].latitude -
|
||||
_simulatedRoute[idx].latitude),
|
||||
_simulatedRoute[idx].longitude +
|
||||
t * (_simulatedRoute[idx + 1].longitude - _simulatedRoute[idx].longitude),
|
||||
t *
|
||||
(_simulatedRoute[idx + 1].longitude -
|
||||
_simulatedRoute[idx].longitude),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -175,8 +178,7 @@ class RideSimulationController extends GetxController {
|
||||
ride.update();
|
||||
|
||||
_logPolylineState('searching');
|
||||
_verifyPolylineCondition(
|
||||
Get.find<MapEngineController>().polyLines.isEmpty,
|
||||
_verifyPolylineCondition(Get.find<MapEngineController>().polyLines.isEmpty,
|
||||
'No route polylines during searching');
|
||||
Log.print('');
|
||||
}
|
||||
@@ -224,17 +226,16 @@ class RideSimulationController extends GetxController {
|
||||
// التحقق من وجود الخطوط المطلوبة
|
||||
final polylines = Get.find<MapEngineController>().polyLines;
|
||||
_verifyPolylineCondition(
|
||||
polylines.any((p) => p.polylineId.value == 'driver_route_solid'),
|
||||
'driver_route_solid (amber solid line) exists');
|
||||
polylines.any((p) => p.polylineId.value == 'driver_route_solid'),
|
||||
'driver_route_solid (amber solid line) exists');
|
||||
_verifyPolylineCondition(
|
||||
polylines.any((p) => p.polylineId.value.startsWith('passenger_walk_line')),
|
||||
'passenger_walk_line (dashed walk line) exists');
|
||||
_verifyPolylineCondition(
|
||||
polylines.any((p) => p.color == Colors.amber),
|
||||
'Amber-colored polyline exists (driver route)');
|
||||
_verifyPolylineCondition(
|
||||
polylines.any((p) => p.color == Colors.blueGrey),
|
||||
'BlueGrey-colored polyline exists (walk dashes)');
|
||||
polylines
|
||||
.any((p) => p.polylineId.value.startsWith('passenger_walk_line')),
|
||||
'passenger_walk_line (dashed walk line) exists');
|
||||
_verifyPolylineCondition(polylines.any((p) => p.color == Colors.amber),
|
||||
'Amber-colored polyline exists (driver route)');
|
||||
_verifyPolylineCondition(polylines.any((p) => p.color == Colors.blueGrey),
|
||||
'BlueGrey-colored polyline exists (walk dashes)');
|
||||
Log.print('');
|
||||
}
|
||||
|
||||
@@ -263,11 +264,12 @@ class RideSimulationController extends GetxController {
|
||||
// التحقق: driver_route_solid يبقى موجود ويتقلص
|
||||
final polylines = Get.find<MapEngineController>().polyLines;
|
||||
_verifyPolylineCondition(
|
||||
polylines.any((p) => p.polylineId.value == 'driver_route_solid'),
|
||||
'driver_route_solid still exists (shrinking)');
|
||||
polylines.any((p) => p.polylineId.value == 'driver_route_solid'),
|
||||
'driver_route_solid still exists (shrinking)');
|
||||
_verifyPolylineCondition(
|
||||
polylines.any((p) => p.polylineId.value.startsWith('passenger_walk_line')),
|
||||
'passenger_walk_line still exists');
|
||||
polylines
|
||||
.any((p) => p.polylineId.value.startsWith('passenger_walk_line')),
|
||||
'passenger_walk_line still exists');
|
||||
Log.print('');
|
||||
}
|
||||
|
||||
@@ -300,11 +302,11 @@ class RideSimulationController extends GetxController {
|
||||
final polylines = Get.find<MapEngineController>().polyLines;
|
||||
// في حالة الوصول: يجب أن يظهر main_route (أزرق) بدلاً من driver_route_solid
|
||||
_verifyPolylineCondition(
|
||||
!polylines.any((p) => p.polylineId.value == 'driver_route_solid'),
|
||||
'driver_route_solid (amber) has been cleared');
|
||||
!polylines.any((p) => p.polylineId.value == 'driver_route_solid'),
|
||||
'driver_route_solid (amber) has been cleared');
|
||||
_verifyPolylineCondition(
|
||||
polylines.any((p) => p.polylineId.value == 'main_route'),
|
||||
'main_route (blue) has been drawn to destination');
|
||||
polylines.any((p) => p.polylineId.value == 'main_route'),
|
||||
'main_route (blue) has been drawn to destination');
|
||||
Log.print('');
|
||||
}
|
||||
|
||||
@@ -335,14 +337,13 @@ class RideSimulationController extends GetxController {
|
||||
|
||||
final polylines = Get.find<MapEngineController>().polyLines;
|
||||
_verifyPolylineCondition(
|
||||
polylines.any((p) => p.polylineId.value == 'main_route'),
|
||||
'main_route (blue) exists for trip');
|
||||
polylines.any((p) => p.polylineId.value == 'main_route'),
|
||||
'main_route (blue) exists for trip');
|
||||
_verifyPolylineCondition(
|
||||
!polylines.any((p) => p.polylineId.value.startsWith('driver_route')),
|
||||
'No driver_route* polylines remain');
|
||||
_verifyPolylineCondition(
|
||||
polylines.any((p) => p.color.value == 0xFF2196F3),
|
||||
'Blue polyline (main route) is present');
|
||||
!polylines.any((p) => p.polylineId.value.startsWith('driver_route')),
|
||||
'No driver_route* polylines remain');
|
||||
_verifyPolylineCondition(polylines.any((p) => p.color.value == 0xFF2196F3),
|
||||
'Blue polyline (main route) is present');
|
||||
Log.print('');
|
||||
}
|
||||
|
||||
@@ -368,11 +369,11 @@ class RideSimulationController extends GetxController {
|
||||
|
||||
final polylines = Get.find<MapEngineController>().polyLines;
|
||||
_verifyPolylineCondition(
|
||||
polylines.any((p) => p.polylineId.value == 'main_route'),
|
||||
'main_route (blue) exists with remaining points');
|
||||
polylines.any((p) => p.polylineId.value == 'main_route'),
|
||||
'main_route (blue) exists with remaining points');
|
||||
_verifyPolylineCondition(
|
||||
!polylines.any((p) => p.polylineId.value.startsWith('driver_route')),
|
||||
'No driver_route* polylines remain');
|
||||
!polylines.any((p) => p.polylineId.value.startsWith('driver_route')),
|
||||
'No driver_route* polylines remain');
|
||||
Log.print('');
|
||||
}
|
||||
|
||||
@@ -392,12 +393,10 @@ class RideSimulationController extends GetxController {
|
||||
|
||||
_logPolylineState('ride_finished');
|
||||
|
||||
_verifyPolylineCondition(Get.find<MapEngineController>().polyLines.isEmpty,
|
||||
'All polylines cleared');
|
||||
_verifyPolylineCondition(
|
||||
Get.find<MapEngineController>().polyLines.isEmpty,
|
||||
'All polylines cleared');
|
||||
_verifyPolylineCondition(
|
||||
Get.find<MapEngineController>().markers.isEmpty,
|
||||
'All markers removed');
|
||||
Get.find<MapEngineController>().markers.isEmpty, 'All markers removed');
|
||||
Log.print('');
|
||||
}
|
||||
|
||||
|
||||
@@ -267,25 +267,25 @@ class UiInteractionsController extends GetxController {
|
||||
rideLifecycle.rideId, rideLifecycle.driverId);
|
||||
|
||||
String message = """
|
||||
مرحباً، تابع رحلتي مباشرة على تطبيق سيرو 🚗
|
||||
مرحباً، تابع رحلتي مباشرة على تطبيق تريبز 🚗
|
||||
|
||||
يمكنك تتبع مسار الرحلة من هنا:
|
||||
$trackingLink
|
||||
|
||||
السائق: ${rideLifecycle.passengerName}
|
||||
السيارة: ${rideLifecycle.model} - ${rideLifecycle.licensePlate}
|
||||
شكراً لاستخدامك سيرو!
|
||||
شكراً لاستخدامك تريبز!
|
||||
"""
|
||||
.tr;
|
||||
|
||||
String messageEn = """Hello, follow my trip live on Siro 🚗
|
||||
String messageEn = """Hello, follow my trip live on Tripz 🚗
|
||||
|
||||
Track my ride here:
|
||||
$trackingLink
|
||||
|
||||
Driver: ${rideLifecycle.passengerName}
|
||||
Car: ${rideLifecycle.model} - ${rideLifecycle.licensePlate}
|
||||
Thank you for using Siro!
|
||||
Thank you for using Tripz!
|
||||
""";
|
||||
|
||||
String userLanguage = box.read(BoxName.lang) ?? 'ar';
|
||||
@@ -338,7 +338,7 @@ Thank you for using Siro!
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
"Send Siro app to him".tr,
|
||||
"Send Tripz app to him".tr,
|
||||
style: AppStyle.title
|
||||
.copyWith(color: AppColor.greenColor, fontSize: 14),
|
||||
textAlign: TextAlign.center,
|
||||
@@ -355,14 +355,14 @@ Thank you for using Siro!
|
||||
|
||||
var message = '''Dear Friend,
|
||||
|
||||
🚀 I have just started an exciting trip on Siro!
|
||||
🚀 I have just started an exciting trip on Tripz!
|
||||
Download the app to track my ride:
|
||||
|
||||
👉 Android: https://play.google.com/store/apps/details?id=com.Siro.siro&hl=en-US
|
||||
👉 iOS: https://apps.apple.com/st/app/siro-rider/id6748075179
|
||||
👉 Android: https://play.google.com/store/apps/details?id=com.Tripz.tripz&hl=en-US
|
||||
👉 iOS: https://apps.apple.com/st/app/tripz-rider/id6748075179
|
||||
|
||||
See you there!
|
||||
Siro Team''';
|
||||
Tripz Team''';
|
||||
|
||||
launchCommunication('whatsapp', phone, message);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user