Update: 2026-06-26 01:43:37
This commit is contained in:
@@ -2,6 +2,7 @@ import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:siro_service/views/widgets/mycircular.dart';
|
||||
import 'package:siro_service/controller/functions/encrypt_decrypt.dart';
|
||||
import 'package:siro_service/views/widgets/my_scafold.dart';
|
||||
|
||||
@@ -99,7 +100,7 @@ class Driverthebest extends GetxController {
|
||||
driver = res['message'];
|
||||
update();
|
||||
} else {
|
||||
Get.snackbar('error', '', backgroundColor: AppColor.redColor);
|
||||
mySnackbarError('Error'.tr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -396,7 +396,7 @@ class ReviewDriverPage extends StatelessWidget {
|
||||
padding: const EdgeInsets.symmetric(vertical: 6),
|
||||
child: Obx(
|
||||
() => DropdownButtonFormField<String>(
|
||||
initialValue: c.selectedGender.value.isEmpty
|
||||
value: c.selectedGender.value.isEmpty
|
||||
? null
|
||||
: c.selectedGender.value,
|
||||
isExpanded: true,
|
||||
@@ -424,7 +424,7 @@ class ReviewDriverPage extends StatelessWidget {
|
||||
padding: const EdgeInsets.symmetric(vertical: 6),
|
||||
child: Obx(
|
||||
() => DropdownButtonFormField<String>(
|
||||
initialValue: c.colorHex.value.isEmpty ? null : c.colorHex.value,
|
||||
value: c.colorHex.value.isEmpty ? null : c.colorHex.value,
|
||||
isExpanded: true,
|
||||
decoration: InputDecoration(
|
||||
labelText: label.tr,
|
||||
@@ -467,7 +467,7 @@ class ReviewDriverPage extends StatelessWidget {
|
||||
padding: const EdgeInsets.symmetric(vertical: 6),
|
||||
child: Obx(
|
||||
() => DropdownButtonFormField<String>(
|
||||
initialValue: ReviewDriverController.kFuelOptions
|
||||
value: ReviewDriverController.kFuelOptions
|
||||
.contains(c.selectedFuel.value)
|
||||
? c.selectedFuel.value
|
||||
: null,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'dart:async';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:siro_service/views/widgets/mycircular.dart';
|
||||
import 'package:siro_service/constant/links.dart';
|
||||
import 'package:siro_service/controller/functions/crud.dart';
|
||||
import 'package:siro_service/views/widgets/my_scafold.dart';
|
||||
@@ -43,7 +44,7 @@ class ActiveRideModel {
|
||||
status: ride['status'] ?? '',
|
||||
startLocation: ride['start_location'] ?? '',
|
||||
endLocation: ride['end_location'] ?? '',
|
||||
driverName: driver['fullname'] ?? driver['first_name'] ?? 'غير معروف',
|
||||
driverName: driver['fullname'] ?? driver['first_name'] ?? 'Unknown'.tr,
|
||||
driverPhone: driver['phone'] ?? '',
|
||||
passengerName: '',
|
||||
passengerPhone: '',
|
||||
@@ -105,8 +106,7 @@ class RideMonitorServiceController extends GetxController {
|
||||
Future<void> searchByPhone() async {
|
||||
final phone = phoneCtrl.text.trim();
|
||||
if (phone.isEmpty) {
|
||||
Get.snackbar('تنبيه', 'يرجى إدخال رقم الهاتف',
|
||||
backgroundColor: Colors.redAccent, colorText: Colors.white);
|
||||
mySnackbarWarning('يرجى إدخال رقم الهاتف'.tr);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -176,8 +176,7 @@ class RideMonitorServiceController extends GetxController {
|
||||
Future<void> searchByRideId() async {
|
||||
final rideId = rideIdCtrl.text.trim();
|
||||
if (rideId.isEmpty) {
|
||||
Get.snackbar('تنبيه', 'يرجى إدخال رقم الرحلة',
|
||||
backgroundColor: Colors.redAccent, colorText: Colors.white);
|
||||
mySnackbarWarning('يرجى إدخال رقم الرحلة'.tr);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -240,7 +239,7 @@ class RideMonitorServicePage extends StatelessWidget {
|
||||
final controller = Get.put(RideMonitorServiceController());
|
||||
|
||||
return MyScaffold(
|
||||
title: 'متابعة الرحلات',
|
||||
title: 'Ride monitoring'.tr,
|
||||
isleading: true,
|
||||
body: [
|
||||
Padding(
|
||||
@@ -253,7 +252,7 @@ class RideMonitorServicePage extends StatelessWidget {
|
||||
children: [
|
||||
Expanded(
|
||||
child: _buildModeButton(
|
||||
'رقم الهاتف',
|
||||
'Phone number'.tr,
|
||||
Icons.phone_rounded,
|
||||
controller.searchMode.value == 'phone',
|
||||
() => controller.searchMode.value = 'phone',
|
||||
@@ -262,7 +261,7 @@ class RideMonitorServicePage extends StatelessWidget {
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: _buildModeButton(
|
||||
'رقم الرحلة',
|
||||
'Trip number'.tr,
|
||||
Icons.confirmation_number_rounded,
|
||||
controller.searchMode.value == 'ride_id',
|
||||
() => controller.searchMode.value = 'ride_id',
|
||||
@@ -320,7 +319,7 @@ class RideMonitorServicePage extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'نتائج البحث (${controller.activeRides.length})',
|
||||
'${'Search results'.tr} (${controller.activeRides.length})',
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
@@ -381,8 +380,8 @@ class RideMonitorServicePage extends StatelessWidget {
|
||||
controller: controller.phoneCtrl,
|
||||
keyboardType: TextInputType.phone,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'رقم الهاتف',
|
||||
hintText: 'مثال: 0992952235 أو 079XXXXXXX',
|
||||
labelText: 'Phone number'.tr,
|
||||
hintText: '0992952235 or 079XXXXXXX'.tr,
|
||||
prefixIcon: const Icon(Icons.phone_rounded),
|
||||
border: OutlineInputBorder(borderRadius: BorderRadius.circular(12)),
|
||||
),
|
||||
@@ -394,8 +393,8 @@ class RideMonitorServicePage extends StatelessWidget {
|
||||
child: ElevatedButton.icon(
|
||||
onPressed: () => controller.searchByPhone(),
|
||||
icon: const Icon(Icons.search_rounded),
|
||||
label: const Text('بحث عن رحلات',
|
||||
style: TextStyle(fontWeight: FontWeight.bold)),
|
||||
label: Text('Search for trips'.tr,
|
||||
style: const TextStyle(fontWeight: FontWeight.bold)),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: const Color(0xFF4318FF),
|
||||
foregroundColor: Colors.white,
|
||||
@@ -415,8 +414,8 @@ class RideMonitorServicePage extends StatelessWidget {
|
||||
controller: controller.rideIdCtrl,
|
||||
keyboardType: TextInputType.number,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'رقم الرحلة',
|
||||
hintText: 'مثال: 12345',
|
||||
labelText: 'Trip number'.tr,
|
||||
hintText: 'Example: 12345'.tr,
|
||||
prefixIcon: const Icon(Icons.confirmation_number_rounded),
|
||||
border: OutlineInputBorder(borderRadius: BorderRadius.circular(12)),
|
||||
),
|
||||
@@ -428,8 +427,8 @@ class RideMonitorServicePage extends StatelessWidget {
|
||||
child: ElevatedButton.icon(
|
||||
onPressed: () => controller.searchByRideId(),
|
||||
icon: const Icon(Icons.search_rounded),
|
||||
label: const Text('بحث برقم الرحلة',
|
||||
style: TextStyle(fontWeight: FontWeight.bold)),
|
||||
label: Text('Search by trip number'.tr,
|
||||
style: const TextStyle(fontWeight: FontWeight.bold)),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: const Color(0xFF4318FF),
|
||||
foregroundColor: Colors.white,
|
||||
@@ -483,7 +482,7 @@ class RideMonitorServicePage extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'رحلة #${ride.rideId}',
|
||||
'${'Trip'.tr} #${ride.rideId}',
|
||||
style: const TextStyle(
|
||||
fontSize: 15, fontWeight: FontWeight.bold),
|
||||
),
|
||||
@@ -509,14 +508,14 @@ class RideMonitorServicePage extends StatelessWidget {
|
||||
style: TextStyle(color: Colors.grey[500], fontSize: 12)),
|
||||
const Divider(height: 20),
|
||||
// Info rows
|
||||
_buildInfoRow(Icons.person_rounded, 'السائق: ${ride.driverName}'),
|
||||
_buildInfoRow(Icons.person_rounded, '${'Driver'.tr}: ${ride.driverName}'),
|
||||
if (ride.driverPhone.isNotEmpty)
|
||||
_buildInfoRow(
|
||||
Icons.phone_rounded, 'هاتف السائق: ${ride.driverPhone}'),
|
||||
_buildInfoRow(Icons.payments_rounded, 'السعر: ${ride.price}'),
|
||||
Icons.phone_rounded, '${'Driver phone'.tr}: ${ride.driverPhone}'),
|
||||
_buildInfoRow(Icons.payments_rounded, '${'Price'.tr}: ${ride.price}'),
|
||||
if (ride.carType.isNotEmpty)
|
||||
_buildInfoRow(
|
||||
Icons.directions_car_rounded, 'نوع السيارة: ${ride.carType}'),
|
||||
Icons.directions_car_rounded, '${'Car type'.tr}: ${ride.carType}'),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:siro_service/views/widgets/mycircular.dart';
|
||||
import 'package:siro_service/constant/colors.dart';
|
||||
import 'package:siro_service/constant/style.dart';
|
||||
import 'package:siro_service/views/widgets/elevated_btn.dart';
|
||||
@@ -144,7 +145,7 @@ class DriverCard extends StatelessWidget {
|
||||
final phone = driver['phone'];
|
||||
|
||||
if (phone == null || phone.toString().isEmpty) {
|
||||
Get.snackbar("خطأ", "لا يوجد رقم هاتف لهذا السائق");
|
||||
mySnackbarError('لا يوجد رقم هاتف لهذا السائق'.tr);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user