Update: 2026-08-07 14:20:27
This commit is contained in:
@@ -808,25 +808,85 @@ class RideLifecycleController extends GetxController {
|
||||
/// خطأ تجربة سيئة، ومنعها من الأساس أوضح.
|
||||
Future<DateTime?> _pickScheduleTime(ScheduledRidesController ctrl) async {
|
||||
final now = DateTime.now();
|
||||
DateTime tempPickedDate = ctrl.earliest;
|
||||
|
||||
final date = await showDatePicker(
|
||||
final picked = await showModalBottomSheet<DateTime>(
|
||||
context: Get.context!,
|
||||
initialDate: ctrl.earliest,
|
||||
firstDate: now,
|
||||
lastDate: ctrl.latest,
|
||||
helpText: 'موعد الرحلة'.tr,
|
||||
);
|
||||
if (date == null) return null;
|
||||
backgroundColor: Colors.transparent,
|
||||
builder: (BuildContext context) {
|
||||
final isDark = Get.isDarkMode;
|
||||
final bgColor = isDark ? const Color(0xFF1E1E1E) : Colors.white;
|
||||
final primaryColor = AppColor.primaryColor;
|
||||
|
||||
final time = await showTimePicker(
|
||||
context: Get.context!,
|
||||
initialTime: TimeOfDay.fromDateTime(ctrl.earliest),
|
||||
helpText: 'وقت الانطلاق'.tr,
|
||||
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 (time == null) return null;
|
||||
|
||||
final picked =
|
||||
DateTime(date.year, date.month, date.day, time.hour, time.minute);
|
||||
if (picked == null) return null;
|
||||
|
||||
// منتقي التاريخ يحصر اليوم لا الساعة، فقد يختار الراكب يوماً صالحاً
|
||||
// بساعة ماضية أو قريبة جداً.
|
||||
|
||||
@@ -1801,4 +1801,7 @@ final Map<String, String> ar_eg = {
|
||||
"Top Up Wallet": "شحن المحفظة",
|
||||
"• Subscription renews automatically every 30 days\n• Cancel anytime from your wallet page\n• Amount is deducted from your in-app wallet": "• يتجدد الاشتراك تلقائياً كل 30 يوماً\n• يمكن الإلغاء في أي وقت من صفحة المحفظة\n• يُخصم المبلغ من محفظتك داخل التطبيق",
|
||||
"service_unavailable_area": "هذه الخدمة غير متوفرة حالياً في منطقتك",
|
||||
"Confirm": "تأكيد",
|
||||
"Cancel": "إلغاء",
|
||||
"Schedule for Later": "احجزها لوقت لاحق"
|
||||
};
|
||||
|
||||
@@ -1815,4 +1815,7 @@ final Map<String, String> ar_jo = {
|
||||
"فشل تسجيل الحضور": "فشل تسجيل الحضور",
|
||||
"لا يوجد ركاب مسجلين في هذه المحطة": "لا يوجد ركاب مسجلين في هذه المحطة",
|
||||
"حاضر": "حاضر",
|
||||
"Confirm": "تأكيد",
|
||||
"Cancel": "إلغاء",
|
||||
"Schedule for Later": "احجزها لوقت لاحق"
|
||||
};
|
||||
|
||||
@@ -1801,4 +1801,7 @@ final Map<String, String> ar_sy = {
|
||||
"Top Up Wallet": "شحن المحفظة",
|
||||
"• Subscription renews automatically every 30 days\n• Cancel anytime from your wallet page\n• Amount is deducted from your in-app wallet": "• يتجدد الاشتراك تلقائياً كل 30 يوماً\n• يمكن الإلغاء في أي وقت من صفحة المحفظة\n• يُخصم المبلغ من محفظتك داخل التطبيق",
|
||||
"service_unavailable_area": "هذه الخدمة غير متوفرة حالياً في منطقتك",
|
||||
"Confirm": "تأكيد",
|
||||
"Cancel": "إلغاء",
|
||||
"Schedule for Later": "احجزها لوقت لاحق"
|
||||
};
|
||||
|
||||
@@ -120,34 +120,49 @@ class CashConfirmPageShown extends StatelessWidget {
|
||||
}
|
||||
// في كل الحالات الأخرى (كاش، أو محفظة برصيد كافٍ)
|
||||
else {
|
||||
return Column(
|
||||
return Row(
|
||||
children: [
|
||||
MyElevatedButton(
|
||||
title: 'Confirm & Find a Ride'.tr,
|
||||
onPressed: () {
|
||||
// --- نفس منطقك القديم بالضبط ---
|
||||
controller.changeCashConfirmPageShown();
|
||||
// controller.isSearchingWindow = true;
|
||||
controller.startSearchingForDriver();
|
||||
// controller.update();
|
||||
},
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: MyElevatedButton(
|
||||
title: 'Confirm & Find a Ride'.tr,
|
||||
onPressed: () {
|
||||
// --- نفس منطقك القديم بالضبط ---
|
||||
controller.changeCashConfirmPageShown();
|
||||
// controller.isSearchingWindow = true;
|
||||
controller.startSearchingForDriver();
|
||||
// controller.update();
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
const SizedBox(width: 8),
|
||||
// مسار موازٍ لا بديل: الحجز لا يفتح نافذة بحث ولا
|
||||
// ينتظر سائقاً — يسجّل موعداً ويتولّاه الخادم.
|
||||
// ثانوي بصرياً عمداً: الرحلة الفورية تبقى الافتراض.
|
||||
TextButton.icon(
|
||||
onPressed: () {
|
||||
controller.changeCashConfirmPageShown();
|
||||
controller.scheduleRideForLater();
|
||||
},
|
||||
icon: Icon(Icons.schedule,
|
||||
size: 18, color: AppColor.primaryColor),
|
||||
label: Text(
|
||||
'احجزها لوقت لاحق'.tr,
|
||||
style: TextStyle(
|
||||
color: AppColor.primaryColor,
|
||||
fontWeight: FontWeight.w600),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: SizedBox(
|
||||
height: 52,
|
||||
child: TextButton.icon(
|
||||
style: TextButton.styleFrom(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 4),
|
||||
),
|
||||
onPressed: () {
|
||||
controller.changeCashConfirmPageShown();
|
||||
controller.scheduleRideForLater();
|
||||
},
|
||||
icon: Icon(Icons.schedule,
|
||||
size: 18, color: AppColor.primaryColor),
|
||||
label: FittedBox(
|
||||
child: Text(
|
||||
'Schedule for Later'.tr,
|
||||
style: TextStyle(
|
||||
color: AppColor.primaryColor,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 14),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -10,6 +10,7 @@ import 'package:siro_rider/constant/style.dart';
|
||||
import 'package:siro_rider/views/home/my_wallet/passenger_wallet.dart';
|
||||
import 'package:siro_rider/views/home/profile/complaint_page.dart';
|
||||
import 'package:siro_rider/views/home/profile/order_history.dart';
|
||||
import 'package:siro_rider/views/scheduled/scheduled_rides_page.dart';
|
||||
import 'package:siro_rider/views/home/profile/promos_passenger_page.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
@@ -174,6 +175,11 @@ class MapMenuWidget extends StatelessWidget {
|
||||
icon: Icons.history_rounded,
|
||||
onTap: () => Get.to(() => const OrderHistory()),
|
||||
),
|
||||
MenuListItem(
|
||||
title: 'Scheduled Rides'.tr,
|
||||
icon: Icons.schedule_rounded,
|
||||
onTap: () => Get.to(() => const ScheduledRidesPage()),
|
||||
),
|
||||
MenuListItem(
|
||||
title: 'Promos'.tr,
|
||||
icon: Icons.local_offer_outlined,
|
||||
|
||||
Reference in New Issue
Block a user