Fixes & Updates - 2026-06-01: Integrate Back-End v3 updates, fix call/connection issues across apps
This commit is contained in:
@@ -11,7 +11,9 @@ import '../../../constant/style.dart';
|
||||
import '../../../controller/functions/audio_record1.dart';
|
||||
import '../../../controller/functions/launch.dart';
|
||||
import '../../../controller/functions/toast.dart';
|
||||
import '../../../controller/home/map_passenger_controller.dart';
|
||||
import '../../../controller/home/map/ride_lifecycle_controller.dart';
|
||||
import '../../../controller/home/map/ui_interactions_controller.dart';
|
||||
import '../../../controller/home/map/ride_state.dart';
|
||||
import '../../../controller/profile/profile_controller.dart';
|
||||
import '../../../main.dart';
|
||||
import '../../../views/home/profile/complaint_page.dart';
|
||||
@@ -24,9 +26,10 @@ class RideBeginPassenger extends StatelessWidget {
|
||||
final ProfileController profileController = Get.put(ProfileController());
|
||||
final AudioRecorderController audioController =
|
||||
Get.put(AudioRecorderController());
|
||||
final uiController = Get.find<UiInteractionsController>();
|
||||
|
||||
return Obx(() {
|
||||
final controller = Get.find<MapPassengerController>();
|
||||
final controller = Get.find<RideLifecycleController>();
|
||||
|
||||
// شرط الإظهار
|
||||
final bool isVisible =
|
||||
@@ -50,8 +53,8 @@ class RideBeginPassenger extends StatelessWidget {
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Get.isDarkMode
|
||||
? Colors.black.withOpacity(0.4)
|
||||
: Colors.black.withOpacity(0.1),
|
||||
? Colors.black.withValues(alpha: 0.4)
|
||||
: Colors.black.withValues(alpha: 0.1),
|
||||
blurRadius: 20,
|
||||
spreadRadius: 2,
|
||||
offset: const Offset(0, -3),
|
||||
@@ -69,7 +72,7 @@ class RideBeginPassenger extends StatelessWidget {
|
||||
width: 40,
|
||||
height: 4,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.grayColor.withOpacity(0.3),
|
||||
color: AppColor.grayColor.withValues(alpha: 0.3),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
),
|
||||
@@ -85,7 +88,7 @@ class RideBeginPassenger extends StatelessWidget {
|
||||
Divider(
|
||||
height: 1,
|
||||
thickness: 0.5,
|
||||
color: AppColor.grayColor.withOpacity(0.2)),
|
||||
color: AppColor.grayColor.withValues(alpha: 0.2)),
|
||||
|
||||
const SizedBox(height: 12),
|
||||
|
||||
@@ -104,7 +107,7 @@ class RideBeginPassenger extends StatelessWidget {
|
||||
}
|
||||
|
||||
// --- الهيدر (بدون تغيير، ممتاز) ---
|
||||
Widget _buildCompactHeader(MapPassengerController controller) {
|
||||
Widget _buildCompactHeader(RideLifecycleController controller) {
|
||||
return Row(
|
||||
children: [
|
||||
// صورة السائق
|
||||
@@ -112,7 +115,7 @@ class RideBeginPassenger extends StatelessWidget {
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
border: Border.all(
|
||||
color: AppColor.primaryColor.withOpacity(0.5), width: 1.5),
|
||||
color: AppColor.primaryColor.withValues(alpha: 0.5), width: 1.5),
|
||||
),
|
||||
child: CircleAvatar(
|
||||
radius: 24,
|
||||
@@ -166,9 +169,9 @@ class RideBeginPassenger extends StatelessWidget {
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 4, vertical: 1),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.writeColor.withOpacity(0.05),
|
||||
color: AppColor.writeColor.withValues(alpha: 0.05),
|
||||
border: Border.all(
|
||||
color: AppColor.grayColor.withOpacity(0.2)),
|
||||
color: AppColor.grayColor.withValues(alpha: 0.2)),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
child: Text(
|
||||
@@ -190,7 +193,7 @@ class RideBeginPassenger extends StatelessWidget {
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 6),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.primaryColor.withOpacity(0.08),
|
||||
color: AppColor.primaryColor.withValues(alpha: 0.08),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Column(
|
||||
@@ -216,9 +219,10 @@ class RideBeginPassenger extends StatelessWidget {
|
||||
// --- الأزرار (بدون تغيير) ---
|
||||
Widget _buildCompactActionButtons(
|
||||
BuildContext context,
|
||||
MapPassengerController controller,
|
||||
RideLifecycleController controller,
|
||||
ProfileController profileController,
|
||||
AudioRecorderController audioController) {
|
||||
final uiController = Get.find<UiInteractionsController>();
|
||||
return SizedBox(
|
||||
height: 60,
|
||||
child: Row(
|
||||
@@ -228,7 +232,7 @@ class RideBeginPassenger extends StatelessWidget {
|
||||
icon: Icons.sos_rounded,
|
||||
label: 'SOS'.tr,
|
||||
color: AppColor.redColor,
|
||||
bgColor: AppColor.redColor.withOpacity(0.1),
|
||||
bgColor: AppColor.redColor.withValues(alpha: 0.1),
|
||||
onTap: () async {
|
||||
if (box.read(BoxName.sosPhonePassenger) == null) {
|
||||
await profileController.updatField(
|
||||
@@ -244,24 +248,26 @@ class RideBeginPassenger extends StatelessWidget {
|
||||
icon: FontAwesome.whatsapp,
|
||||
label: 'WhatsApp'.tr,
|
||||
color: const Color(0xFF25D366),
|
||||
bgColor: const Color(0xFF25D366).withOpacity(0.1),
|
||||
bgColor: const Color(0xFF25D366).withValues(alpha: 0.1),
|
||||
onTap: () async {
|
||||
if (box.read(BoxName.sosPhonePassenger) == null) {
|
||||
await profileController.updatField(
|
||||
'sosPhone', TextInputType.phone);
|
||||
final phone = box.read(BoxName.sosPhonePassenger);
|
||||
if (phone == null || phone.toString().isEmpty) {
|
||||
// لا يوجد رقم طوارئ — نعرض الديالوج لإدخاله
|
||||
await uiController.shareTripWithFamily();
|
||||
} else {
|
||||
final phone = controller.formatSyrianPhoneNumber(
|
||||
box.read(BoxName.sosPhonePassenger).toString());
|
||||
controller.sendWhatsapp(phone);
|
||||
final formattedPhone = uiController.formatSyrianPhoneNumber(
|
||||
phone.toString());
|
||||
uiController.sendWhatsapp(formattedPhone);
|
||||
}
|
||||
},
|
||||
),
|
||||
|
||||
_compactBtn(
|
||||
icon: Icons.share,
|
||||
label: 'Share'.tr,
|
||||
color: AppColor.primaryColor,
|
||||
bgColor: AppColor.primaryColor.withOpacity(0.1),
|
||||
onTap: () async => await controller.shareTripWithFamily(),
|
||||
bgColor: AppColor.primaryColor.withValues(alpha: 0.1),
|
||||
onTap: () async => await uiController.shareTripWithFamily(),
|
||||
),
|
||||
GetBuilder<AudioRecorderController>(
|
||||
init: audioController,
|
||||
@@ -275,15 +281,19 @@ class RideBeginPassenger extends StatelessWidget {
|
||||
? AppColor.redColor
|
||||
: AppColor.primaryColor,
|
||||
bgColor: audioCtx.isRecording
|
||||
? AppColor.redColor.withOpacity(0.1)
|
||||
: AppColor.primaryColor.withOpacity(0.1),
|
||||
? AppColor.redColor.withValues(alpha: 0.1)
|
||||
: AppColor.primaryColor.withValues(alpha: 0.1),
|
||||
onTap: () async {
|
||||
if (!audioCtx.isRecording) {
|
||||
await audioCtx.startRecording();
|
||||
Toast.show(context, 'Start Record'.tr, AppColor.greenColor);
|
||||
await audioCtx.startRecording(rideId: controller.rideId);
|
||||
if (context.mounted) {
|
||||
Toast.show(context, 'Start Record'.tr, AppColor.greenColor);
|
||||
}
|
||||
} else {
|
||||
await audioCtx.stopRecording();
|
||||
Toast.show(context, 'Record saved'.tr, AppColor.greenColor);
|
||||
if (context.mounted) {
|
||||
Toast.show(context, 'Record saved'.tr, AppColor.greenColor);
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
@@ -293,7 +303,7 @@ class RideBeginPassenger extends StatelessWidget {
|
||||
icon: Icons.info_outline_rounded,
|
||||
label: 'Report'.tr,
|
||||
color: AppColor.grayColor,
|
||||
bgColor: AppColor.writeColor.withOpacity(0.1),
|
||||
bgColor: AppColor.writeColor.withValues(alpha: 0.1),
|
||||
onTap: () => Get.to(() => ComplaintPage()),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user