Update: 2026-06-26 02:00:23
This commit is contained in:
@@ -28,9 +28,9 @@ class DriverTheBestAlexandria extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
title: Text((driver['name_arabic']) ??
|
||||
'Unknown Name'),
|
||||
'Unknown Name'.tr),
|
||||
subtitle: Text(
|
||||
'Phone: ${(driver['phone']) ?? 'N/A'}'),
|
||||
'${'Phone'.tr}: ${(driver['phone']) ?? 'N/A'.tr}'),
|
||||
trailing: IconButton(
|
||||
onPressed: () async {
|
||||
Get.defaultDialog(
|
||||
@@ -45,8 +45,8 @@ class DriverTheBestAlexandria extends StatelessWidget {
|
||||
);
|
||||
},
|
||||
)
|
||||
: const Center(
|
||||
child: Text('No drivers available.'),
|
||||
: Center(
|
||||
child: Text('No drivers available.'.tr),
|
||||
);
|
||||
})
|
||||
],
|
||||
|
||||
@@ -55,9 +55,9 @@ class DriverTheBest extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
title: Text((driver['name_arabic']) ??
|
||||
'Unknown Name'),
|
||||
'Unknown Name'.tr),
|
||||
subtitle: Text(
|
||||
'Phone: ${(driver['phone']) ?? 'N/A'}'),
|
||||
'${'Phone'.tr}: ${(driver['phone']) ?? 'N/A'.tr}'),
|
||||
trailing: IconButton(
|
||||
onPressed: () async {
|
||||
// Get.defaultDialog(
|
||||
@@ -79,8 +79,8 @@ class DriverTheBest extends StatelessWidget {
|
||||
},
|
||||
),
|
||||
)
|
||||
: const Center(
|
||||
child: Text('No drivers available.'),
|
||||
: Center(
|
||||
child: Text('No drivers available.'.tr),
|
||||
);
|
||||
}),
|
||||
],
|
||||
|
||||
@@ -60,11 +60,11 @@ class DriverPage extends StatelessWidget {
|
||||
Get.bottomSheet(
|
||||
CupertinoPageScaffold(
|
||||
navigationBar: CupertinoNavigationBar(
|
||||
middle: Text("Edit $label"),
|
||||
middle: Text('${'Edit'.tr} $label'),
|
||||
trailing: GestureDetector(
|
||||
child: const Text(
|
||||
"Save",
|
||||
style: TextStyle(color: CupertinoColors.activeBlue),
|
||||
child: Text(
|
||||
'Save'.tr,
|
||||
style: const TextStyle(color: CupertinoColors.activeBlue),
|
||||
),
|
||||
onTap: () {
|
||||
mainController.updateDriverField(key, controller.text);
|
||||
|
||||
@@ -28,9 +28,9 @@ class DriverTheBestGiza extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
title: Text((driver['name_arabic']) ??
|
||||
'Unknown Name'),
|
||||
'Unknown Name'.tr),
|
||||
subtitle: Text(
|
||||
'Phone: ${(driver['phone']) ?? 'N/A'}'),
|
||||
'${'Phone'.tr}: ${(driver['phone']) ?? 'N/A'.tr}'),
|
||||
trailing: IconButton(
|
||||
onPressed: () async {
|
||||
Get.defaultDialog(
|
||||
@@ -45,8 +45,8 @@ class DriverTheBestGiza extends StatelessWidget {
|
||||
);
|
||||
},
|
||||
)
|
||||
: const Center(
|
||||
child: Text('No drivers available.'),
|
||||
: Center(
|
||||
child: Text('No drivers available.'.tr),
|
||||
);
|
||||
})
|
||||
],
|
||||
|
||||
@@ -25,7 +25,7 @@ class PassengersCantRegister extends StatelessWidget {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: CupertinoFormSection(
|
||||
header: Text('Passenger ID: ${passenger['id']}'),
|
||||
header: Text('${'Passenger ID'.tr}: ${passenger['id']}'),
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () =>
|
||||
|
||||
@@ -28,12 +28,12 @@ class PassengersPage extends StatelessWidget {
|
||||
],
|
||||
)
|
||||
else
|
||||
const Center(
|
||||
Center(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(24.0),
|
||||
padding: const EdgeInsets.all(24.0),
|
||||
child: Text(
|
||||
'No passenger data available.',
|
||||
style: TextStyle(fontSize: 18, fontWeight: FontWeight.w500),
|
||||
'No passenger data available.'.tr,
|
||||
style: const TextStyle(fontSize: 18, fontWeight: FontWeight.w500),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -140,7 +140,7 @@ class ReviewDriverPage extends StatelessWidget {
|
||||
children: [
|
||||
Icon(Icons.image_not_supported, size: 48, color: Colors.grey[400]),
|
||||
const SizedBox(height: 8),
|
||||
Text('No image available', style: TextStyle(color: Colors.grey[500])),
|
||||
Text('No image available'.tr, style: TextStyle(color: Colors.grey[500])),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -159,7 +159,7 @@ class ReviewDriverPage extends StatelessWidget {
|
||||
height: 180,
|
||||
color: Colors.grey[200],
|
||||
child: Center(
|
||||
child: Text('Failed to load image',
|
||||
child: Text('Failed to load image'.tr,
|
||||
style: TextStyle(color: Colors.grey[500])),
|
||||
),
|
||||
),
|
||||
@@ -193,7 +193,7 @@ class ReviewDriverPage extends StatelessWidget {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('${c.country} - Criminal Record',
|
||||
Text('${c.country} - ${'Criminal Record'.tr}',
|
||||
style: const TextStyle(fontSize: 18, fontWeight: FontWeight.bold)),
|
||||
const Divider(),
|
||||
Card(
|
||||
@@ -223,7 +223,7 @@ class ReviewDriverPage extends StatelessWidget {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('Profile Photo',
|
||||
Text('Profile Photo'.tr,
|
||||
style: const TextStyle(fontSize: 18, fontWeight: FontWeight.bold)),
|
||||
const Divider(),
|
||||
Card(
|
||||
@@ -237,7 +237,7 @@ class ReviewDriverPage extends StatelessWidget {
|
||||
Expanded(
|
||||
child: Text(
|
||||
'Verify the profile photo matches the person in the ID '
|
||||
'and Driver License photos above.',
|
||||
'and Driver License photos above.'.tr,
|
||||
style: TextStyle(color: Colors.blue[800]),
|
||||
),
|
||||
),
|
||||
@@ -256,7 +256,7 @@ class ReviewDriverPage extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'${c.country} - ${c.tabLabels[tabKey] ?? tabKey}',
|
||||
'${c.country} - ${(c.tabLabels[tabKey] ?? tabKey).tr}',
|
||||
style: const TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
|
||||
),
|
||||
const Divider(),
|
||||
@@ -268,13 +268,13 @@ class ReviewDriverPage extends StatelessWidget {
|
||||
String _getCriminalRecordHint(String country) {
|
||||
switch (country) {
|
||||
case 'Syria':
|
||||
return 'Review the "لا حكم عليه" document. Verify name matches driver.';
|
||||
return 'Review the "لا حكم عليه" document. Verify name matches driver.'.tr;
|
||||
case 'Jordan':
|
||||
return 'Review the "عدم محكومية" document. Verify name matches driver.';
|
||||
return 'Review the "عدم محكومية" document. Verify name matches driver.'.tr;
|
||||
case 'Egypt':
|
||||
return 'Review the "فيش وتشبيه" document. Verify name matches driver.';
|
||||
return 'Review the "فيش وتشبيه" document. Verify name matches driver.'.tr;
|
||||
default:
|
||||
return 'Review the criminal record document. Verify name matches driver.';
|
||||
return 'Review the criminal record document. Verify name matches driver.'.tr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -481,7 +481,7 @@ class ReviewDriverPage extends StatelessWidget {
|
||||
const EdgeInsets.symmetric(horizontal: 12, vertical: 14),
|
||||
),
|
||||
items: ReviewDriverController.kFuelOptions.map((v) {
|
||||
return DropdownMenuItem(value: v, child: Text(v));
|
||||
return DropdownMenuItem(value: v, child: Text(v.tr));
|
||||
}).toList(),
|
||||
onChanged: (v) {
|
||||
if (v != null) c.selectedFuel.value = v;
|
||||
|
||||
@@ -55,28 +55,6 @@ class ActiveRideModel {
|
||||
}
|
||||
}
|
||||
|
||||
/// --------------------------------------------------------------------------
|
||||
/// تطبيع رقم الهاتف تلقائياً حسب الدولة
|
||||
/// --------------------------------------------------------------------------
|
||||
String normalizePhone(String input) {
|
||||
final clean = input.replaceAll(RegExp(r'\D+'), '');
|
||||
// Syria
|
||||
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
|
||||
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
|
||||
if (clean.length == 11 && clean.startsWith('01'))
|
||||
return '20${clean.substring(1)}';
|
||||
if (clean.length == 13 && clean.startsWith('20')) return clean;
|
||||
return clean;
|
||||
}
|
||||
|
||||
/// --------------------------------------------------------------------------
|
||||
/// الـ Controller
|
||||
/// --------------------------------------------------------------------------
|
||||
@@ -116,7 +94,7 @@ class RideMonitorServiceController extends GetxController {
|
||||
activeRides.clear();
|
||||
|
||||
try {
|
||||
final normalizedPhone = normalizePhone(phone);
|
||||
final normalizedPhone = CRUD.normalizePhone(phone);
|
||||
|
||||
// محاولة البحث أولاً عن رحلة نشطة
|
||||
var res = await CRUD().post(
|
||||
@@ -158,15 +136,15 @@ class RideMonitorServiceController extends GetxController {
|
||||
hasResult.value = true;
|
||||
} else {
|
||||
hasError.value = true;
|
||||
errorMessage.value = 'لا توجد رحلات لهذا الرقم';
|
||||
errorMessage.value = 'No rides found for this number'.tr;
|
||||
}
|
||||
} else {
|
||||
hasError.value = true;
|
||||
errorMessage.value = 'لم يتم العثور على المستخدم';
|
||||
errorMessage.value = 'User not found'.tr;
|
||||
}
|
||||
} catch (e) {
|
||||
hasError.value = true;
|
||||
errorMessage.value = 'خطأ في الاتصال: $e';
|
||||
errorMessage.value = '${'Connection error'.tr}: $e';
|
||||
} finally {
|
||||
isLoading.value = false;
|
||||
}
|
||||
@@ -213,15 +191,15 @@ class RideMonitorServiceController extends GetxController {
|
||||
hasResult.value = true;
|
||||
} else {
|
||||
hasError.value = true;
|
||||
errorMessage.value = 'لم يتم العثور على رحلة بهذا الرقم';
|
||||
errorMessage.value = 'No ride found for this number'.tr;
|
||||
}
|
||||
} else {
|
||||
hasError.value = true;
|
||||
errorMessage.value = 'فشل في جلب الرحلات';
|
||||
errorMessage.value = 'Failed to fetch rides'.tr;
|
||||
}
|
||||
} catch (e) {
|
||||
hasError.value = true;
|
||||
errorMessage.value = 'خطأ في الاتصال: $e';
|
||||
errorMessage.value = '${'Connection error'.tr}: $e';
|
||||
} finally {
|
||||
isLoading.value = false;
|
||||
}
|
||||
|
||||
@@ -24,12 +24,12 @@ class WelcomeCall extends StatelessWidget {
|
||||
final drivers = mainController.newDriverRegister;
|
||||
|
||||
if (drivers.isEmpty) {
|
||||
return const Padding(
|
||||
padding: EdgeInsets.all(32.0),
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(32.0),
|
||||
child: Center(
|
||||
child: Text(
|
||||
'No new drivers found.',
|
||||
style: TextStyle(fontSize: 18),
|
||||
'No new drivers found.'.tr,
|
||||
style: const TextStyle(fontSize: 18),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user