Update codebase
This commit is contained in:
@@ -42,7 +42,7 @@ VARS=$(cat "$ORIG_FILE" | awk '
|
||||
# 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|TripzMapController)$/) {
|
||||
if ($i ~ /^(var|final|const|late|RxBool|RxInt|RxDouble|RxString|RxList|RxMap|RxSet|Rx|String|int|double|bool|List|Map|Set|Timer|LatLng|Position|SiroMapController)$/) {
|
||||
# The next field might be the variable name, or it might have a type like String?
|
||||
name = $(i+1)
|
||||
# Remove trailing ?, ;, =
|
||||
|
||||
@@ -47,7 +47,7 @@ def extract_declarations(text):
|
||||
|
||||
# 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|TripzMapController)\??\s+([a-zA-Z0-9_]+)\b'
|
||||
r'\b(?:var|final|const|late|RxBool|RxInt|RxDouble|RxString|RxList|RxMap|RxSet|Rx|String|int|double|bool|List|Map|Set|Timer|LatLng|Position|SiroMapController)\??\s+([a-zA-Z0-9_]+)\b'
|
||||
)
|
||||
|
||||
variables = set()
|
||||
|
||||
@@ -51,7 +51,7 @@ class ContactUsController extends GetxController {
|
||||
}
|
||||
|
||||
void sendEmail() {
|
||||
launchCommunication('email', 'support@tripzapp.com', 'Hello'.tr);
|
||||
launchCommunication('email', 'support@intaleqapp.com', 'Hello'.tr);
|
||||
}
|
||||
|
||||
/// SHOW DIALOG (Optional legacy support)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'package:tripz_rider/print.dart';
|
||||
import 'package:siro_rider/print.dart';
|
||||
import 'dart:async';
|
||||
import 'package:app_links/app_links.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'package:tripz_rider/print.dart';
|
||||
import 'package:siro_rider/print.dart';
|
||||
import 'dart:io';
|
||||
import 'dart:convert';
|
||||
import 'package:live_activities/live_activities.dart';
|
||||
@@ -10,7 +10,7 @@ class IosLiveActivityService {
|
||||
static void init() {
|
||||
if (Platform.isIOS) {
|
||||
_liveActivitiesPlugin.init(
|
||||
appGroupId: "group.com.Tripz.tripz",
|
||||
appGroupId: "group.com.Siro.siro",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,6 +163,7 @@ class LocationSearchController extends GetxController {
|
||||
];
|
||||
readyWayPoints();
|
||||
getLocation();
|
||||
_listenForDeepLink();
|
||||
}
|
||||
|
||||
void readyWayPoints() {
|
||||
@@ -319,8 +320,7 @@ 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);
|
||||
@@ -507,13 +507,11 @@ 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) {
|
||||
@@ -562,8 +560,7 @@ 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) {
|
||||
@@ -904,8 +901,7 @@ 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:tripz_rider/controller/home/map/ride_lifecycle_controller.dart';
|
||||
import 'package:siro_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('🗺️ Tripz Map Style Loaded. Initializing...');
|
||||
Log.print('🗺️ Siro Map Style Loaded. Initializing...');
|
||||
isStyleLoaded = true;
|
||||
await _loadMapIcons();
|
||||
|
||||
@@ -567,6 +567,17 @@ class MapEngineController extends GetxController {
|
||||
update();
|
||||
}
|
||||
|
||||
/// إغلاق القائمة الجانبية بشكل مباشر (idempotent) — بعكس [getDrawerMenu]
|
||||
/// التي تعمل كمفتاح تبديل، هذه تُغلق فقط ولا تفتح إن كانت مغلقة أصلاً.
|
||||
void closeDrawerMenu() {
|
||||
if (!heightMenuBool) return;
|
||||
heightMenuBool = false;
|
||||
widthMapTypeAndTraffic = 50;
|
||||
heightMenu = 0;
|
||||
widthMenu = 0;
|
||||
update();
|
||||
}
|
||||
|
||||
void changeMainBottomMenuMap() {
|
||||
if (isWayPointStopsSheetUtilGetMap == true) {
|
||||
changeWayPointSheet();
|
||||
|
||||
@@ -118,8 +118,7 @@ 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();
|
||||
@@ -151,8 +150,7 @@ 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,8 +34,7 @@ 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;
|
||||
}
|
||||
|
||||
@@ -86,8 +85,7 @@ 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(
|
||||
@@ -336,8 +334,7 @@ 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);
|
||||
@@ -410,8 +407,7 @@ class NearbyDriversController extends GetxController {
|
||||
};
|
||||
|
||||
if (mapEngine.mapController != null) {
|
||||
mapEngine.mapController!
|
||||
.animateCamera(CameraUpdate.newLatLng(currentPos));
|
||||
mapEngine.mapController!.animateCamera(CameraUpdate.newLatLng(currentPos));
|
||||
}
|
||||
|
||||
mapEngine.update();
|
||||
|
||||
@@ -30,6 +30,8 @@ import '../../../services/ride_live_notification.dart';
|
||||
import '../../../views/home/map_page_passenger.dart';
|
||||
import '../../../views/Rate/rate_captain.dart';
|
||||
import '../../../views/Rate/rating_driver_bottom.dart';
|
||||
import '../../../views/scheduled/scheduled_rides_page.dart';
|
||||
import '../../scheduled/scheduled_rides_controller.dart';
|
||||
import '../../../views/widgets/mydialoug.dart';
|
||||
import '../../../views/widgets/elevated_btn.dart';
|
||||
import '../../../views/home/map_widget.dart/car_details_widget_to_go.dart';
|
||||
@@ -70,7 +72,7 @@ class RideLifecycleController extends GetxController {
|
||||
bool isWhatsAppOrder = false;
|
||||
LatLng startLocation = const LatLng(32, 35);
|
||||
LatLng endLocation = const LatLng(32, 35);
|
||||
String dynamicApiUrl = 'https://routec.tripz.xyz/route';
|
||||
String dynamicApiUrl = 'https://routec.intaleq.xyz/route';
|
||||
String? cardNumber;
|
||||
bool isBeginRideFromDriverRunning = false;
|
||||
bool isDriversTokensSend = false;
|
||||
@@ -660,6 +662,42 @@ class RideLifecycleController extends GetxController {
|
||||
_handleRideState(currentRideState.value);
|
||||
}
|
||||
|
||||
/// يسأل الخادم عن آخر رحلة منتهية لم تُقيَّم خلال آخر أسبوع، ويفتح
|
||||
/// شاشة التقييم إن وُجدت.
|
||||
///
|
||||
/// لا يرمي أبداً ولا يوقف شيئاً: تعذّر التقييم لا يمنع الراكب من طلب
|
||||
/// رحلة جديدة.
|
||||
Future<void> _checkPendingRating() async {
|
||||
if (_isRatingScreenOpen) return;
|
||||
|
||||
try {
|
||||
final res = await CRUD().post(
|
||||
link: AppLink.pendingRating,
|
||||
payload: {'role': 'passenger'},
|
||||
);
|
||||
|
||||
final data = res is Map ? (res['message'] ?? res['data']) : null;
|
||||
if (data is! Map || data['pending'] != true) return;
|
||||
|
||||
_isRatingScreenOpen = true;
|
||||
await Get.to(
|
||||
() => RatingDriverBottomSheet(),
|
||||
arguments: {
|
||||
'driverId': data['targetId']?.toString() ?? '',
|
||||
'rideId': data['rideId']?.toString() ?? '',
|
||||
'driverName': data['targetName']?.toString() ?? '',
|
||||
'price': data['price']?.toString() ?? '',
|
||||
},
|
||||
preventDuplicates: true,
|
||||
popGesture: false,
|
||||
);
|
||||
_isRatingScreenOpen = false;
|
||||
} catch (e) {
|
||||
Log.print('⚠️ تعذّر فحص التقييم المتأخر: $e');
|
||||
_isRatingScreenOpen = false;
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _checkLastRideForReview() async {
|
||||
// 🛡️ Gatekeeper: منع فتح التقييم مرتين (Race Condition)
|
||||
if (_isReviewProcessed) {
|
||||
@@ -704,6 +742,11 @@ class RideLifecycleController extends GetxController {
|
||||
currentRideState.value = RideState.noRide;
|
||||
startMasterTimer();
|
||||
} else {
|
||||
// لا تقييم ضمن نافذة الساعة — لكن قد يكون هناك تقييم متأخر لرحلة
|
||||
// أقدم. needsReview محصور بتلك النافذة عمداً (وظيفتها استئناف رحلة
|
||||
// قائمة)، فمن يغلق التطبيق فور نزوله لا يصله طلب تقييم أبداً.
|
||||
await _checkPendingRating();
|
||||
|
||||
// 🔥 [Fix Polyline] لا حاجة للتقييم — لازم نمسح مسار الرحلة المنتهية
|
||||
// قبل العودة لحالة noRide، وإلا يبقى ظاهراً على الخريطة الخاملة
|
||||
restCounter();
|
||||
@@ -718,6 +761,144 @@ class RideLifecycleController extends GetxController {
|
||||
bool _isRideBeginLogicExecuted = false;
|
||||
String driversStatusForSearchWindow = '';
|
||||
|
||||
/// يفتح منتقي الموعد ثم يُنشئ حجزاً بدل رحلة فورية.
|
||||
///
|
||||
/// المسار موازٍ لـ startSearchingForDriver لا بديل عنه: الحجز لا يفتح
|
||||
/// نافذة بحث ولا يوصل السوكِت ولا ينتظر سائقاً — يسجّل نيّة سفر فقط،
|
||||
/// ويتولّى الكرون تحويلها لرحلة قبل الموعد بهامش.
|
||||
Future<void> scheduleRideForLater() async {
|
||||
if (mapEngine.polylineCoordinates.isEmpty) {
|
||||
mySnackbarWarning('حدّد وجهتك أولاً'.tr);
|
||||
return;
|
||||
}
|
||||
|
||||
final ctrl = Get.put(ScheduledRidesController());
|
||||
final picked = await _pickScheduleTime(ctrl);
|
||||
if (picked == null) return;
|
||||
|
||||
final startLoc = mapEngine.polylineCoordinates.first;
|
||||
final endLoc = mapEngine.polylineCoordinates.last;
|
||||
|
||||
final ok = await ctrl.create(
|
||||
startLocation: '${startLoc.latitude},${startLoc.longitude}',
|
||||
endLocation: '${endLoc.latitude},${endLoc.longitude}',
|
||||
startName: startNameAddress,
|
||||
endName: endNameAddress,
|
||||
carType: box.read(BoxName.carType)?.toString() ?? 'Speed',
|
||||
distanceKm: double.tryParse(distance.toString()) ?? 0,
|
||||
// duration بالثواني (سطر 102) — نفس ما يُرسل في postRideDetailsToServer.
|
||||
durationSeconds: duration.round(),
|
||||
estimatedPrice: double.tryParse(totalPassenger.toString()) ?? 0,
|
||||
when: picked,
|
||||
);
|
||||
|
||||
if (ok) {
|
||||
// نعيد الخريطة لحالتها الخاملة: الحجز ليس رحلة جارية، وإبقاء
|
||||
// المسار مرسوماً يوهم الراكب أن سائقاً في طريقه إليه الآن.
|
||||
restCounter();
|
||||
currentRideState.value = RideState.noRide;
|
||||
update();
|
||||
Get.to(() => const ScheduledRidesPage());
|
||||
}
|
||||
}
|
||||
|
||||
/// منتقي التاريخ ثم الوقت، محصور بحدود الخادم.
|
||||
///
|
||||
/// الحصر في المنتقي نفسه لا بعده: عرض مواعيد يرفضها الخادم ثم إظهار
|
||||
/// خطأ تجربة سيئة، ومنعها من الأساس أوضح.
|
||||
Future<DateTime?> _pickScheduleTime(ScheduledRidesController ctrl) async {
|
||||
final now = DateTime.now();
|
||||
DateTime tempPickedDate = ctrl.earliest;
|
||||
|
||||
final picked = await showModalBottomSheet<DateTime>(
|
||||
context: Get.context!,
|
||||
backgroundColor: Colors.transparent,
|
||||
builder: (BuildContext context) {
|
||||
final isDark = Get.isDarkMode;
|
||||
final bgColor = isDark ? const Color(0xFF1E1E1E) : Colors.white;
|
||||
final primaryColor = AppColor.primaryColor;
|
||||
|
||||
return Container(
|
||||
height: 320,
|
||||
decoration: BoxDecoration(
|
||||
color: bgColor,
|
||||
borderRadius: const BorderRadius.only(
|
||||
topLeft: Radius.circular(20),
|
||||
topRight: Radius.circular(20),
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
// Header
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
bottom: BorderSide(
|
||||
color: isDark ? Colors.white12 : Colors.black12,
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(context),
|
||||
child: Text(
|
||||
'Cancel'.tr,
|
||||
style: TextStyle(color: Colors.redAccent, fontSize: 16),
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(context, tempPickedDate),
|
||||
child: Text(
|
||||
'Confirm'.tr,
|
||||
style: TextStyle(
|
||||
color: primaryColor,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
// Cupertino Picker
|
||||
Expanded(
|
||||
child: CupertinoTheme(
|
||||
data: CupertinoThemeData(
|
||||
brightness: isDark ? Brightness.dark : Brightness.light,
|
||||
),
|
||||
child: CupertinoDatePicker(
|
||||
mode: CupertinoDatePickerMode.dateAndTime,
|
||||
initialDateTime: ctrl.earliest,
|
||||
minimumDate: now,
|
||||
maximumDate: ctrl.latest,
|
||||
use24hFormat: false,
|
||||
onDateTimeChanged: (DateTime newDateTime) {
|
||||
tempPickedDate = newDateTime;
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
if (picked == null) return null;
|
||||
|
||||
// منتقي التاريخ يحصر اليوم لا الساعة، فقد يختار الراكب يوماً صالحاً
|
||||
// بساعة ماضية أو قريبة جداً.
|
||||
if (picked.isBefore(ctrl.earliest)) {
|
||||
mySnackbarWarning(
|
||||
'اختر موعداً بعد ${ScheduledRidesController.minLeadMinutes} دقيقة على الأقل'.tr);
|
||||
return null;
|
||||
}
|
||||
|
||||
return picked;
|
||||
}
|
||||
|
||||
void startSearchingForDriver() async {
|
||||
if (currentRideState.value == RideState.searching) return;
|
||||
|
||||
@@ -1665,7 +1846,7 @@ class RideLifecycleController extends GetxController {
|
||||
|
||||
Future<void> getInitialDriverDistanceAndDuration(
|
||||
LatLng driverPos, LatLng passengerPos) async {
|
||||
final String apiUrl = 'https://routec.tripz.xyz/route';
|
||||
final String apiUrl = 'https://routec.intaleq.xyz/route';
|
||||
final String apiKey = Env.mapKeyOsm;
|
||||
final String origin = '${driverPos.latitude},${driverPos.longitude}';
|
||||
final String dest = '${passengerPos.latitude},${passengerPos.longitude}';
|
||||
@@ -1700,7 +1881,7 @@ class RideLifecycleController extends GetxController {
|
||||
String distanceByPassenger = '';
|
||||
|
||||
Future<void> drawDriverPathOnly(LatLng driverPos, LatLng passengerPos) async {
|
||||
final String apiUrl = 'https://routec.tripz.xyz/route';
|
||||
final String apiUrl = 'https://routec.intaleq.xyz/route';
|
||||
final String apiKey = Env.mapKeyOsm;
|
||||
final String origin = '${driverPos.latitude},${driverPos.longitude}';
|
||||
final String dest = '${passengerPos.latitude},${passengerPos.longitude}';
|
||||
@@ -1888,14 +2069,14 @@ class RideLifecycleController extends GetxController {
|
||||
String generateTrackingLink(String rideId, String driverId) {
|
||||
String cleanRideId = rideId.toString().trim();
|
||||
String cleanDriverId = driverId.toString().trim();
|
||||
const String secretSalt = "Tripz_Secure_Track_2025";
|
||||
const String secretSalt = "Siro_Secure_Track_2025";
|
||||
|
||||
String rawString = "$cleanRideId$cleanDriverId$secretSalt";
|
||||
var bytes = utf8.encode(rawString);
|
||||
var digest = md5.convert(bytes);
|
||||
String token = digest.toString();
|
||||
|
||||
return "https://tripzmove.com/track/index.php?id=$cleanRideId&token=$token";
|
||||
return "https://siromove.com/track/index.php?id=$cleanRideId&token=$token";
|
||||
}
|
||||
|
||||
calcualateDistsanceInMetet(LatLng prev, current) async {
|
||||
@@ -2165,7 +2346,7 @@ class RideLifecycleController extends GetxController {
|
||||
fetchCompetitorContext();
|
||||
}
|
||||
|
||||
/// يجلب مقارنة سعر تريبز مع المنافسين ويحدّث الواجهة بشكل غير مُوقِف
|
||||
/// يجلب مقارنة سعر سيرو مع المنافسين ويحدّث الواجهة بشكل غير مُوقِف
|
||||
Future<void> fetchCompetitorContext() async {
|
||||
try {
|
||||
final String passengerLat = mapEngine.polylineCoordinates.isNotEmpty
|
||||
@@ -2182,7 +2363,7 @@ class RideLifecycleController extends GetxController {
|
||||
'passenger_lng': passengerLng,
|
||||
'distance': distance.toString(),
|
||||
'country': box.read(BoxName.countryCode) ?? '',
|
||||
'tripz_price': totalPassengerSpeed,
|
||||
'siro_price': totalPassengerSpeed,
|
||||
'car_type': 'Speed',
|
||||
},
|
||||
);
|
||||
@@ -2213,11 +2394,11 @@ class RideLifecycleController extends GetxController {
|
||||
{bool isBeginPhase = false}) async {
|
||||
if (mapController == null) {
|
||||
Log.print(
|
||||
'⚠️ mapController is null, cannot calculate route via tripz_maps');
|
||||
'⚠️ mapController is null, cannot calculate route via intaleq_maps');
|
||||
return;
|
||||
}
|
||||
|
||||
Log.print('📍 Calculating Driver Route via TripzMapController...');
|
||||
Log.print('📍 Calculating Driver Route via IntaleqMapController...');
|
||||
|
||||
try {
|
||||
final responseData =
|
||||
@@ -3754,8 +3935,9 @@ 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',
|
||||
@@ -3990,6 +4172,55 @@ class RideLifecycleController extends GetxController {
|
||||
}
|
||||
}
|
||||
|
||||
/// يسأل الخادم كم سيكلّف الإلغاء، ويعرض تأكيداً إن كان هناك رسم.
|
||||
///
|
||||
/// يرجع true للمتابعة وfalse للتراجع. الإعفاءات الثلاثة (لا سائق قَبِل،
|
||||
/// ضمن الدقائق المجانية، السائق تأخّر) يحسمها الخادم فلا حاجة لتكرار
|
||||
/// المنطق هنا — وتكراره كان سيسمح للنسختين بالتباعد.
|
||||
///
|
||||
/// عند أي فشل شبكي نُكمل الإلغاء بلا تحذير: حبس الراكب في رحلة بسبب
|
||||
/// عطل عندنا أسوأ من خصم لم يُحذَّر منه.
|
||||
Future<bool> _confirmCancelFee() async {
|
||||
if (rideId == 'yet' || rideId == null) return true;
|
||||
|
||||
try {
|
||||
final res = await CRUD().post(
|
||||
link: AppLink.previewCancelFee,
|
||||
payload: {"ride_id": rideId.toString()},
|
||||
);
|
||||
|
||||
final data = res is Map ? (res['message'] ?? res['data']) : null;
|
||||
if (data is! Map) return true;
|
||||
|
||||
final bool willCharge = data['will_charge'] == true;
|
||||
if (!willCharge) return true;
|
||||
|
||||
final String amount = data['cancel_fee']?.toString() ?? '0';
|
||||
final String currency = data['fee_currency']?.toString() ?? '';
|
||||
|
||||
bool confirmed = false;
|
||||
await Get.defaultDialog(
|
||||
title: 'تأكيد الإلغاء'.tr,
|
||||
middleText:
|
||||
'السائق في طريقه إليك. سيُخصم $amount $currency كتعويض له عن'
|
||||
' المسافة والوقت.'
|
||||
.tr,
|
||||
textConfirm: 'إلغاء الرحلة'.tr,
|
||||
textCancel: 'تراجع'.tr,
|
||||
onConfirm: () {
|
||||
confirmed = true;
|
||||
Get.back();
|
||||
},
|
||||
onCancel: () => confirmed = false,
|
||||
);
|
||||
|
||||
return confirmed;
|
||||
} catch (e) {
|
||||
Log.print("⚠️ تعذّرت معاينة رسم الإلغاء: $e");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> cancelRide() async {
|
||||
if (selectedReasonIndex == -1) {
|
||||
mySnackbarWarning('Please select a reason first'.tr);
|
||||
@@ -4005,6 +4236,11 @@ class RideLifecycleController extends GetxController {
|
||||
finalReason = otherReasonController.text.trim();
|
||||
}
|
||||
|
||||
// تحذير الرسم قبل أي تفكيك للحالة. لو جاء بعده، ورفض الراكب
|
||||
// الاستمرار، لوجد رحلته وقد أُلغيت على الشاشة بلا رجعة.
|
||||
final bool proceed = await _confirmCancelFee();
|
||||
if (!proceed) return;
|
||||
|
||||
Get.back();
|
||||
if (isCancelRidePageShown) {
|
||||
mapEngine.changeCancelRidePageShow();
|
||||
@@ -4488,7 +4724,7 @@ class RideLifecycleController extends GetxController {
|
||||
}
|
||||
|
||||
/// Builds a Set of short [Polyline] segments that simulate a dashed line.
|
||||
/// tripz_maps (MapLibre) doesn't support `patterns`, so we manually
|
||||
/// intaleq_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,8 +20,9 @@ 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;
|
||||
@@ -34,8 +35,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));
|
||||
}
|
||||
}
|
||||
@@ -150,13 +151,9 @@ 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),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -178,7 +175,8 @@ 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('');
|
||||
}
|
||||
@@ -226,16 +224,17 @@ 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('');
|
||||
}
|
||||
|
||||
@@ -264,12 +263,11 @@ 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('');
|
||||
}
|
||||
|
||||
@@ -302,11 +300,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('');
|
||||
}
|
||||
|
||||
@@ -337,13 +335,14 @@ 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('');
|
||||
}
|
||||
|
||||
@@ -369,11 +368,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('');
|
||||
}
|
||||
|
||||
@@ -393,10 +392,12 @@ class RideSimulationController extends GetxController {
|
||||
|
||||
_logPolylineState('ride_finished');
|
||||
|
||||
_verifyPolylineCondition(Get.find<MapEngineController>().polyLines.isEmpty,
|
||||
'All polylines cleared');
|
||||
_verifyPolylineCondition(
|
||||
Get.find<MapEngineController>().markers.isEmpty, 'All markers removed');
|
||||
Get.find<MapEngineController>().polyLines.isEmpty,
|
||||
'All polylines cleared');
|
||||
_verifyPolylineCondition(
|
||||
Get.find<MapEngineController>().markers.isEmpty,
|
||||
'All markers removed');
|
||||
Log.print('');
|
||||
}
|
||||
|
||||
|
||||
@@ -128,6 +128,10 @@ class UiInteractionsController extends GetxController {
|
||||
kolor: AppColor.redColor,
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
// الشركة أولاً ثم الواتساب: تسجيل البلاغ لا ينتظر شيئاً ولا
|
||||
// يؤخّر الرسالة (بلا await)، لكنه يُطلق قبلها حتى لا يضيع
|
||||
// إن أغلق المستخدم التطبيق بعد فتح واتساب.
|
||||
_reportSafetyIncident();
|
||||
_shareTripDetailsSOS();
|
||||
},
|
||||
),
|
||||
@@ -142,6 +146,32 @@ class UiInteractionsController extends GetxController {
|
||||
});
|
||||
}
|
||||
|
||||
/// يسجّل البلاغ لدى الشركة: يُنشئ سجل حادثة، يُجمّد إسناد الرحلات
|
||||
/// للسائق حتى المراجعة، ويُنبّه غرفة العمليات.
|
||||
///
|
||||
/// لا ينتظر ولا يرمي: زر الطوارئ يجب ألا يتعطّل أبداً بسبب الشبكة.
|
||||
/// أي فشل هنا لا يمنع رسالة الواتساب التي تليه.
|
||||
void _reportSafetyIncident({String trigger = 'sos_button'}) {
|
||||
try {
|
||||
final rideLifecycle = Get.find<RideLifecycleController>();
|
||||
final locSearch = Get.find<LocationSearchController>();
|
||||
|
||||
CRUD().post(
|
||||
link: AppLink.safetyIncident,
|
||||
payload: {
|
||||
'reporter_type': 'passenger',
|
||||
'reporter_id': box.read(BoxName.passengerID).toString(),
|
||||
'ride_id': rideLifecycle.rideId?.toString() ?? '',
|
||||
'trigger_type': trigger,
|
||||
'lat': locSearch.passengerLocation.latitude.toString(),
|
||||
'lng': locSearch.passengerLocation.longitude.toString(),
|
||||
},
|
||||
);
|
||||
} catch (e) {
|
||||
Log.print("⚠️ تعذّر تسجيل بلاغ السلامة: $e");
|
||||
}
|
||||
}
|
||||
|
||||
void _shareTripDetailsSOS() {
|
||||
final rideLifecycle = Get.find<RideLifecycleController>();
|
||||
final locSearch = Get.find<LocationSearchController>();
|
||||
@@ -267,14 +297,14 @@ class UiInteractionsController extends GetxController {
|
||||
rideLifecycle.rideId, rideLifecycle.driverId);
|
||||
|
||||
String message = """
|
||||
مرحباً، تابع رحلتي مباشرة على تطبيق تريبز 🚗
|
||||
مرحباً، تابع رحلتي مباشرة على تطبيق سيرو 🚗
|
||||
|
||||
يمكنك تتبع مسار الرحلة من هنا:
|
||||
$trackingLink
|
||||
|
||||
السائق: ${rideLifecycle.passengerName}
|
||||
السيارة: ${rideLifecycle.model} - ${rideLifecycle.licensePlate}
|
||||
شكراً لاستخدامك تريبز!
|
||||
شكراً لاستخدامك سيرو!
|
||||
"""
|
||||
.tr;
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// import 'package:tripz_rider/constant/currency.dart';
|
||||
// import 'package:siro_rider/constant/currency.dart';
|
||||
import 'dart:async';
|
||||
// import 'package:tripz_rider/services/offline_map_service.dart';
|
||||
// import 'package:tripz_rider/services/emergency_signal_service.dart';
|
||||
// import 'package:tripz_rider/views/widgets/mycircular.dart';
|
||||
// import 'package:siro_rider/services/offline_map_service.dart';
|
||||
// import 'package:siro_rider/services/emergency_signal_service.dart';
|
||||
// import 'package:siro_rider/views/widgets/mycircular.dart';
|
||||
// import 'dart:convert';
|
||||
// import 'dart:io';
|
||||
// import 'dart:math' show Random, atan2, cos, max, min, pi, pow, sin, sqrt;
|
||||
@@ -10,37 +10,37 @@ import 'dart:async';
|
||||
// import 'dart:ui';
|
||||
// import 'dart:typed_data';
|
||||
// import 'package:image/image.dart' as img;
|
||||
// import 'package:tripz_rider/services/ride_live_notification.dart';
|
||||
// import 'package:siro_rider/services/ride_live_notification.dart';
|
||||
// import 'package:crypto/crypto.dart';
|
||||
// import 'package:tripz_rider/views/Rate/rate_captain.dart';
|
||||
// import 'package:tripz_rider/views/Rate/rating_driver_bottom.dart';
|
||||
// import 'package:siro_rider/views/Rate/rate_captain.dart';
|
||||
// import 'package:siro_rider/views/Rate/rating_driver_bottom.dart';
|
||||
// import 'package:device_info_plus/device_info_plus.dart';
|
||||
// import 'package:flutter/foundation.dart';
|
||||
// import 'package:flutter/services.dart';
|
||||
// import 'package:http/http.dart' as http;
|
||||
|
||||
// import 'package:tripz_rider/constant/univeries_polygon.dart';
|
||||
// import 'package:tripz_rider/controller/firebase/local_notification.dart';
|
||||
// import 'package:siro_rider/constant/univeries_polygon.dart';
|
||||
// import 'package:siro_rider/controller/firebase/local_notification.dart';
|
||||
// import 'package:flutter/cupertino.dart';
|
||||
// import 'package:flutter_confetti/flutter_confetti.dart' hide Circle;
|
||||
// import 'package:socket_io_client/socket_io_client.dart' as IO;
|
||||
// import 'package:vector_math/vector_math.dart' show radians;
|
||||
|
||||
// import 'package:tripz_rider/controller/functions/tts.dart';
|
||||
// import 'package:tripz_rider/views/home/map_page_passenger.dart';
|
||||
// import 'package:tripz_rider/views/widgets/my_textField.dart';
|
||||
// import 'package:siro_rider/controller/functions/tts.dart';
|
||||
// import 'package:siro_rider/views/home/map_page_passenger.dart';
|
||||
// import 'package:siro_rider/views/widgets/my_textField.dart';
|
||||
// import 'package:flutter/material.dart';
|
||||
// import 'package:geolocator/geolocator.dart';
|
||||
// import 'package:get/get.dart';
|
||||
// import 'package:tripz_maps/tripz_maps.dart';
|
||||
// import 'package:intaleq_maps/intaleq_maps.dart';
|
||||
// // import 'package:google_polyline_algorithm/google_polyline_algorithm.dart';
|
||||
// import 'package:intl/intl.dart';
|
||||
// import 'package:location/location.dart';
|
||||
// import 'package:tripz_rider/constant/country_polygons.dart';
|
||||
// import 'package:tripz_rider/constant/links.dart';
|
||||
// import 'package:tripz_rider/constant/style.dart';
|
||||
// import 'package:tripz_rider/controller/home/points_for_rider_controller.dart';
|
||||
// import 'package:tripz_rider/views/home/map_widget.dart/form_serch_multiy_point.dart';
|
||||
// import 'package:siro_rider/constant/country_polygons.dart';
|
||||
// import 'package:siro_rider/constant/links.dart';
|
||||
// import 'package:siro_rider/constant/style.dart';
|
||||
// import 'package:siro_rider/controller/home/points_for_rider_controller.dart';
|
||||
// import 'package:siro_rider/views/home/map_widget.dart/form_serch_multiy_point.dart';
|
||||
// import '../../constant/api_key.dart';
|
||||
// import '../../constant/box_name.dart';
|
||||
// import '../../constant/colors.dart';
|
||||
@@ -127,7 +127,7 @@ import 'dart:async';
|
||||
// formSearchPlaces(3),
|
||||
// ];
|
||||
|
||||
// TripzMapController? mapController;
|
||||
// SiroMapController? mapController;
|
||||
// bool isStyleLoaded = false;
|
||||
|
||||
// Set<Marker> markers = {};
|
||||
@@ -3357,7 +3357,7 @@ import 'dart:async';
|
||||
// /// تستخدم API سريع (overview=false)
|
||||
// Future<void> getInitialDriverDistanceAndDuration(
|
||||
// LatLng driverPos, LatLng passengerPos) async {
|
||||
// final String apiUrl = 'https://routec.tripz.xyz/route';
|
||||
// final String apiUrl = 'https://routec.intaleq.xyz/route';
|
||||
// final String apiKey = Env.mapKeyOsm;
|
||||
|
||||
// final String origin = '${driverPos.latitude},${driverPos.longitude}';
|
||||
@@ -3408,7 +3408,7 @@ import 'dart:async';
|
||||
|
||||
// // دالة خفيفة وسريعة لرسم خط المسار فقط (بدون أسعار أو خطوات)
|
||||
// Future<void> drawDriverPathOnly(LatLng driverPos, LatLng passengerPos) async {
|
||||
// final String apiUrl = 'https://routec.tripz.xyz/route';
|
||||
// final String apiUrl = 'https://routec.intaleq.xyz/route';
|
||||
// final String apiKey = Env.mapKeyOsm;
|
||||
|
||||
// final String origin = '${driverPos.latitude},${driverPos.longitude}';
|
||||
@@ -3931,7 +3931,7 @@ import 'dart:async';
|
||||
// String cleanDriverId = driverId.toString().trim();
|
||||
|
||||
// // الكلمة السرية للمطابقة مع السيرفر
|
||||
// const String secretSalt = "Tripz_Secure_Track_2025";
|
||||
// const String secretSalt = "Siro_Secure_Track_2025";
|
||||
|
||||
// // الدمج والتشفير
|
||||
// String rawString = "$cleanRideId$cleanDriverId$secretSalt";
|
||||
@@ -3940,7 +3940,7 @@ import 'dart:async';
|
||||
// String token = digest.toString();
|
||||
|
||||
// // الرابط المباشر لصفحة التتبع
|
||||
// return "https://tripzapp.com/track/index.php?id=$cleanRideId&token=$token";
|
||||
// return "https://intaleqapp.com/track/index.php?id=$cleanRideId&token=$token";
|
||||
// }
|
||||
|
||||
// // 2. الدالة الرئيسية (تم تعديلها لإرسال واتساب بدلاً من الإشعارات)
|
||||
@@ -4007,25 +4007,25 @@ import 'dart:async';
|
||||
// // 4. تجهيز الرسالة (بالإنجليزية وجاهزة للترجمة)
|
||||
// // لاحظ: استخدمت المتغيرات الموجودة في الكنترولر (passengerName هنا عادة يحمل اسم السائق في الكنترولر الخاص بك حسب الكود السابق)
|
||||
// String message = """
|
||||
// مرحباً، تابع رحلتي مباشرة على تطبيق تريبز 🚗
|
||||
// مرحباً، تابع رحلتي مباشرة على تطبيق سيرو 🚗
|
||||
|
||||
// يمكنك تتبع مسار الرحلة من هنا:
|
||||
// $trackingLink
|
||||
|
||||
// السائق: $passengerName
|
||||
// السيارة: $model - $licensePlate
|
||||
// شكراً لاستخدامك تريبز!
|
||||
// شكراً لاستخدامك سيرو!
|
||||
// """
|
||||
// .tr;
|
||||
|
||||
// String messageEn = """Hello, follow my trip live on Tripz 🚗
|
||||
// String messageEn = """Hello, follow my trip live on Siro 🚗
|
||||
|
||||
// Track my ride here:
|
||||
// $trackingLink
|
||||
|
||||
// Driver: $passengerName
|
||||
// Car: $model - $licensePlate
|
||||
// Thank you for using Tripz!
|
||||
// Thank you for using Siro!
|
||||
// """;
|
||||
|
||||
// // اختر الرسالة بناءً على اللغة المفضلة (مثال بسيط)
|
||||
@@ -4132,7 +4132,7 @@ import 'dart:async';
|
||||
// ),
|
||||
// const SizedBox(height: 10),
|
||||
// Text(
|
||||
// "Send Tripz app to him".tr,
|
||||
// "Send Siro app to him".tr,
|
||||
// style: AppStyle.title
|
||||
// .copyWith(color: AppColor.greenColor, fontSize: 14),
|
||||
// textAlign: TextAlign.center,
|
||||
@@ -4153,14 +4153,14 @@ import 'dart:async';
|
||||
// // تصحيح نص الرسالة
|
||||
// var message = '''Dear Friend,
|
||||
|
||||
// 🚀 I have just started an exciting trip on Tripz!
|
||||
// 🚀 I have just started an exciting trip on Siro!
|
||||
// Download the app to track my ride:
|
||||
|
||||
// 👉 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
|
||||
// 👉 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
|
||||
|
||||
// See you there!
|
||||
// Tripz Team''';
|
||||
// Siro Team''';
|
||||
|
||||
// launchCommunication('whatsapp', phone, message);
|
||||
// }),
|
||||
@@ -4519,7 +4519,7 @@ import 'dart:async';
|
||||
// if (mapController != null) {
|
||||
// mapController!.animateCamera(CameraUpdate.newLatLng(
|
||||
// currentPos)); // Optional: Follow car if needed
|
||||
// // Note: TripzMapController doesn't expose raw symbol update yet for Marker object,
|
||||
// // Note: SiroMapController doesn't expose raw symbol update yet for Marker object,
|
||||
// // but declarative update via GetBuilder is fast.
|
||||
// }
|
||||
|
||||
@@ -5452,13 +5452,13 @@ import 'dart:async';
|
||||
// );
|
||||
// }
|
||||
|
||||
// void onMapCreated(TripzMapController controller) {
|
||||
// void onMapCreated(SiroMapController controller) {
|
||||
// mapController = controller;
|
||||
// update();
|
||||
// }
|
||||
|
||||
// void onStyleLoaded() async {
|
||||
// Log.print('🗺️ Tripz Map Style Loaded. Initializing...');
|
||||
// Log.print('🗺️ Siro Map Style Loaded. Initializing...');
|
||||
// isStyleLoaded = true;
|
||||
// _loadMapIcons();
|
||||
|
||||
@@ -5912,7 +5912,7 @@ import 'dart:async';
|
||||
// });
|
||||
// }
|
||||
|
||||
// String dynamicApiUrl = 'https://routec.tripz.xyz/route';
|
||||
// String dynamicApiUrl = 'https://routec.intaleq.xyz/route';
|
||||
// Future<void> getDistanceFromDriverAfterAcceptedRide(
|
||||
// String origin, String destination) async {
|
||||
// String apiKey = Env.mapKeyOsm; // مفتاح API الخاص بك
|
||||
|
||||
@@ -2,10 +2,10 @@ import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tripz_rider/constant/box_name.dart';
|
||||
import 'package:tripz_rider/constant/links.dart';
|
||||
import 'package:tripz_rider/controller/functions/crud.dart';
|
||||
import 'package:tripz_rider/main.dart';
|
||||
import 'package:siro_rider/constant/box_name.dart';
|
||||
import 'package:siro_rider/constant/links.dart';
|
||||
import 'package:siro_rider/controller/functions/crud.dart';
|
||||
import 'package:siro_rider/main.dart';
|
||||
|
||||
class CaptainWalletController extends GetxController {
|
||||
bool isLoading = false;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:intaleq_maps/intaleq_maps.dart';
|
||||
import 'package:tripz_rider/controller/home/map/ride_lifecycle_controller.dart';
|
||||
import 'package:siro_rider/controller/home/map/ride_lifecycle_controller.dart';
|
||||
|
||||
import '../../constant/api_key.dart';
|
||||
import '../../constant/links.dart';
|
||||
|
||||
@@ -4,12 +4,12 @@ import 'dart:io';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:tripz_rider/constant/box_name.dart';
|
||||
import 'package:tripz_rider/constant/colors.dart';
|
||||
import 'package:tripz_rider/constant/links.dart';
|
||||
import 'package:tripz_rider/controller/functions/crud.dart';
|
||||
import 'package:tripz_rider/main.dart';
|
||||
import 'package:tripz_rider/views/widgets/error_snakbar.dart';
|
||||
import 'package:siro_rider/constant/box_name.dart';
|
||||
import 'package:siro_rider/constant/colors.dart';
|
||||
import 'package:siro_rider/constant/links.dart';
|
||||
import 'package:siro_rider/controller/functions/crud.dart';
|
||||
import 'package:siro_rider/main.dart';
|
||||
import 'package:siro_rider/views/widgets/error_snakbar.dart';
|
||||
import 'package:http_parser/http_parser.dart';
|
||||
import 'package:mime/mime.dart';
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import 'package:tripz_rider/constant/box_name.dart';
|
||||
import 'package:tripz_rider/constant/colors.dart';
|
||||
import 'package:tripz_rider/constant/links.dart';
|
||||
import 'package:tripz_rider/controller/functions/country_logic.dart';
|
||||
import 'package:tripz_rider/controller/functions/crud.dart';
|
||||
import 'package:siro_rider/constant/box_name.dart';
|
||||
import 'package:siro_rider/constant/colors.dart';
|
||||
import 'package:siro_rider/constant/links.dart';
|
||||
import 'package:siro_rider/controller/functions/country_logic.dart';
|
||||
import 'package:siro_rider/controller/functions/crud.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_contacts/flutter_contacts.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tripz_rider/constant/box_name.dart';
|
||||
import 'package:tripz_rider/constant/links.dart';
|
||||
import 'package:tripz_rider/controller/functions/crud.dart';
|
||||
import 'package:tripz_rider/main.dart';
|
||||
import 'package:tripz_rider/views/widgets/error_snakbar.dart';
|
||||
import 'package:siro_rider/constant/box_name.dart';
|
||||
import 'package:siro_rider/constant/links.dart';
|
||||
import 'package:siro_rider/controller/functions/crud.dart';
|
||||
import 'package:siro_rider/main.dart';
|
||||
import 'package:siro_rider/views/widgets/error_snakbar.dart';
|
||||
|
||||
class InvitesRewardsController extends GetxController {
|
||||
bool isLoading = false;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tripz_rider/constant/box_name.dart';
|
||||
import 'package:tripz_rider/constant/links.dart';
|
||||
import 'package:tripz_rider/controller/functions/crud.dart';
|
||||
import 'package:tripz_rider/main.dart';
|
||||
import 'package:siro_rider/constant/box_name.dart';
|
||||
import 'package:siro_rider/constant/links.dart';
|
||||
import 'package:siro_rider/controller/functions/crud.dart';
|
||||
import 'package:siro_rider/main.dart';
|
||||
|
||||
class OrderHistoryController extends GetxController {
|
||||
List<dynamic> orderHistoryListPassenger = [];
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:tripz_rider/constant/box_name.dart';
|
||||
import 'package:siro_rider/constant/box_name.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tripz_rider/constant/links.dart';
|
||||
import 'package:tripz_rider/controller/functions/crud.dart';
|
||||
import 'package:siro_rider/constant/links.dart';
|
||||
import 'package:siro_rider/controller/functions/crud.dart';
|
||||
|
||||
import '../../../main.dart';
|
||||
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import 'package:tripz_rider/print.dart';
|
||||
import 'package:siro_rider/print.dart';
|
||||
import 'dart:async';
|
||||
import 'dart:math';
|
||||
import 'package:tripz_rider/controller/functions/crud.dart';
|
||||
import 'package:siro_rider/controller/functions/crud.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
import 'package:tripz_rider/constant/box_name.dart';
|
||||
import 'package:tripz_rider/onbording_page.dart';
|
||||
import 'package:tripz_rider/views/auth/login_page.dart';
|
||||
import 'package:tripz_rider/controller/auth/login_controller.dart';
|
||||
import 'package:tripz_rider/controller/functions/secure_storage.dart';
|
||||
import 'package:siro_rider/constant/box_name.dart';
|
||||
import 'package:siro_rider/onbording_page.dart';
|
||||
import 'package:siro_rider/views/auth/login_page.dart';
|
||||
import 'package:siro_rider/controller/auth/login_controller.dart';
|
||||
import 'package:siro_rider/controller/functions/secure_storage.dart';
|
||||
import 'package:quick_actions/quick_actions.dart';
|
||||
import '../../../constant/notification.dart';
|
||||
import '../../../main.dart';
|
||||
@@ -183,18 +183,18 @@ class SplashScreenController extends GetxController
|
||||
final List<String> msgs = passengerMessages ?? const [];
|
||||
if (msgs.isEmpty) {
|
||||
controller.scheduleNotificationsForSevenDays(
|
||||
'Tripz', 'مرحباً بك! تابع رحلاتك بأمان مع تريبز.', "tone1");
|
||||
'Siro', 'مرحباً بك! تابع رحلاتك بأمان مع سيرو.', "tone1");
|
||||
} else {
|
||||
final rnd = Random();
|
||||
final raw = msgs[rnd.nextInt(msgs.length)];
|
||||
final parts = raw.split(':');
|
||||
final title = parts.isNotEmpty ? parts.first.trim() : 'Tripz';
|
||||
final title = parts.isNotEmpty ? parts.first.trim() : 'Siro';
|
||||
final body = parts.length > 1
|
||||
? parts.sublist(1).join(':').trim()
|
||||
: 'مرحباً بك! تابع رحلاتك بأمان مع تريبز.';
|
||||
: 'مرحباً بك! تابع رحلاتك بأمان مع سيرو.';
|
||||
controller.scheduleNotificationsForSevenDays(
|
||||
title.isEmpty ? 'Tripz' : title,
|
||||
body.isEmpty ? 'مرحباً بك! تابع رحلاتك بأمان مع تريبز.' : body,
|
||||
title.isEmpty ? 'Siro' : title,
|
||||
body.isEmpty ? 'مرحباً بك! تابع رحلاتك بأمان مع سيرو.' : body,
|
||||
"tone1");
|
||||
}
|
||||
} catch (e, st) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:tripz_rider/constant/links.dart';
|
||||
import 'package:tripz_rider/controller/functions/crud.dart';
|
||||
import 'package:siro_rider/constant/links.dart';
|
||||
import 'package:siro_rider/controller/functions/crud.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:tripz_rider/constant/box_name.dart';
|
||||
import 'package:tripz_rider/constant/colors.dart';
|
||||
import 'package:tripz_rider/constant/links.dart';
|
||||
import 'package:tripz_rider/controller/home/map/ride_lifecycle_controller.dart';
|
||||
import 'package:tripz_rider/main.dart';
|
||||
import 'package:tripz_rider/views/widgets/elevated_btn.dart';
|
||||
import 'package:tripz_rider/views/widgets/my_scafold.dart';
|
||||
import 'package:tripz_rider/views/widgets/mycircular.dart';
|
||||
import 'package:siro_rider/constant/box_name.dart';
|
||||
import 'package:siro_rider/constant/colors.dart';
|
||||
import 'package:siro_rider/constant/links.dart';
|
||||
import 'package:siro_rider/controller/home/map/ride_lifecycle_controller.dart';
|
||||
import 'package:siro_rider/main.dart';
|
||||
import 'package:siro_rider/views/widgets/elevated_btn.dart';
|
||||
import 'package:siro_rider/views/widgets/my_scafold.dart';
|
||||
import 'package:siro_rider/views/widgets/mycircular.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
Reference in New Issue
Block a user