Update: 2026-06-26 17:29:23
This commit is contained in:
@@ -6,6 +6,7 @@ import 'package:latlong2/latlong.dart';
|
||||
import 'package:siro_admin/constant/links.dart';
|
||||
// Keep your specific imports
|
||||
import 'package:siro_admin/controller/functions/crud.dart';
|
||||
import 'package:siro_admin/views/widgets/snackbar.dart';
|
||||
|
||||
/// --------------------------------------------------------------------------
|
||||
/// 1. DATA MODELS
|
||||
@@ -49,20 +50,23 @@ String normalizePhone(String input) {
|
||||
final clean = input.replaceAll(RegExp(r'\D+'), '');
|
||||
|
||||
// Syria: 099XXXXXXX or 9639XXXXXXX
|
||||
if (clean.length == 10 && clean.startsWith('09'))
|
||||
if (clean.length == 10 && clean.startsWith('09')) {
|
||||
return '963${clean.substring(1)}';
|
||||
}
|
||||
if (clean.length == 12 && clean.startsWith('963')) return clean;
|
||||
if (clean.length == 9 && clean.startsWith('9')) return '963$clean';
|
||||
|
||||
// Jordan: 079XXXXXXX or 9627XXXXXXX
|
||||
if (clean.length == 10 && clean.startsWith('07'))
|
||||
if (clean.length == 10 && clean.startsWith('07')) {
|
||||
return '962${clean.substring(1)}';
|
||||
}
|
||||
if (clean.length == 12 && clean.startsWith('962')) return clean;
|
||||
if (clean.length == 9 && clean.startsWith('7')) return '962$clean';
|
||||
|
||||
// Egypt: 010XXXXXXXX or 2010XXXXXXXX
|
||||
if (clean.length == 11 && clean.startsWith('01'))
|
||||
if (clean.length == 11 && clean.startsWith('01')) {
|
||||
return '20${clean.substring(1)}';
|
||||
}
|
||||
if (clean.length == 13 && clean.startsWith('20')) return clean;
|
||||
|
||||
return clean;
|
||||
@@ -107,15 +111,7 @@ class RideMonitorController extends GetxController {
|
||||
|
||||
void startSearch() {
|
||||
if (phoneInputController.text.trim().isEmpty) {
|
||||
Get.snackbar(
|
||||
"تنبيه",
|
||||
"يرجى إدخال رقم الهاتف أولاً",
|
||||
backgroundColor: Colors.redAccent.withOpacity(0.9),
|
||||
colorText: Colors.white,
|
||||
snackPosition: SnackPosition.TOP,
|
||||
margin: const EdgeInsets.all(15),
|
||||
borderRadius: 15,
|
||||
);
|
||||
mySnackbarWarning("يرجى إدخال رقم الهاتف أولاً");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -297,9 +293,10 @@ class RideMonitorScreen extends StatelessWidget {
|
||||
appBar: PreferredSize(
|
||||
preferredSize: const Size.fromHeight(kToolbarHeight),
|
||||
child: Obx(() {
|
||||
if (controller.isTracking.value)
|
||||
if (controller.isTracking.value) {
|
||||
return const SizedBox
|
||||
.shrink(); // إخفاء الـ AppBar في وضع التتبع للخريطة الكاملة
|
||||
}
|
||||
return AppBar(
|
||||
backgroundColor: Colors.transparent,
|
||||
elevation: 0,
|
||||
@@ -460,7 +457,7 @@ class RideMonitorScreen extends StatelessWidget {
|
||||
PolylineLayer(
|
||||
polylines: [
|
||||
Polyline(
|
||||
points: controller.routePolyline.value,
|
||||
points: controller.routePolyline,
|
||||
strokeWidth: 6.0,
|
||||
color: primaryColor.withOpacity(0.9),
|
||||
borderStrokeWidth: 2.0,
|
||||
|
||||
Reference in New Issue
Block a user