fix: stabilize passenger mapping interactions and finalize localization

This commit is contained in:
Hamza-Ayed
2026-04-18 19:16:01 +03:00
parent a54a7a4189
commit 61343111a2
28 changed files with 14917 additions and 14716 deletions

View File

@@ -319,90 +319,100 @@ class MyDialog extends GetxController {
HapticFeedback.mediumImpact();
Get.dialog(
_DialogShell(
child: _GlassCard(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
// ── Body ──────────────────────────────────────────────
Padding(
padding: const EdgeInsets.fromLTRB(24, 28, 24, 20),
child: Column(
children: [
// Icon badge
Container(
width: 56,
height: 56,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: (isDestructive
? AppColor.redColor
: AppColor.primaryColor)
.withOpacity(0.1),
border: Border.all(
Builder(builder: (dialogContext) {
return _DialogShell(
child: _GlassCard(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
// ── Body ──────────────────────────────────────────────
Padding(
padding: const EdgeInsets.fromLTRB(24, 28, 24, 20),
child: Column(
children: [
// Icon badge
Container(
width: 56,
height: 56,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: (isDestructive
? AppColor.redColor
: AppColor.primaryColor)
.withOpacity(0.2),
.withOpacity(0.1),
border: Border.all(
color: (isDestructive
? AppColor.redColor
: AppColor.primaryColor)
.withOpacity(0.2),
),
),
),
child: Icon(
icon ??
(isDestructive
? Icons.warning_amber_rounded
: Icons.info_outline_rounded),
color: isDestructive
? AppColor.redColor
: AppColor.primaryColor,
size: 26,
),
),
const SizedBox(height: 16),
// Title
Text(
title,
textAlign: TextAlign.center,
style: AppStyle.title.copyWith(
fontSize: 18,
fontWeight: FontWeight.w700,
letterSpacing: -0.4,
color: AppColor.writeColor,
),
),
if (midTitle != null && midTitle.isNotEmpty) ...[
const SizedBox(height: 10),
Text(
midTitle,
textAlign: TextAlign.center,
style: AppStyle.subtitle.copyWith(
fontSize: 14.5,
height: 1.5,
color: Colors.grey[600],
child: Icon(
icon ??
(isDestructive
? Icons.warning_amber_rounded
: Icons.info_outline_rounded),
color: isDestructive
? AppColor.redColor
: AppColor.primaryColor,
size: 26,
),
),
const SizedBox(height: 16),
// TTS button
_SpeakButton(
texts: [title, if (midTitle.isNotEmpty) midTitle]),
],
],
),
),
// Title
Text(
title,
textAlign: TextAlign.center,
style: AppStyle.title.copyWith(
fontSize: 18,
fontWeight: FontWeight.w700,
letterSpacing: -0.4,
color: AppColor.writeColor,
),
),
// ── Actions ───────────────────────────────────────────
_ActionRow(
onCancel: () => Get.back(),
onConfirm: onPressed,
confirmLabel: 'OK'.tr,
isDestructive: isDestructive,
),
],
if (midTitle != null && midTitle.isNotEmpty) ...[
const SizedBox(height: 10),
Text(
midTitle,
textAlign: TextAlign.center,
style: AppStyle.subtitle.copyWith(
fontSize: 14.5,
height: 1.5,
color: Colors.grey[600],
),
),
const SizedBox(height: 16),
// TTS button
_SpeakButton(
texts: [title, if (midTitle.isNotEmpty) midTitle]),
],
],
),
),
// ── Actions ───────────────────────────────────────────
_ActionRow(
onCancel: () =>
Navigator.of(dialogContext, rootNavigator: true).pop(),
onConfirm: () {
// إغلاق الديالوج مباشرة باستخدام Navigator.pop
Navigator.of(dialogContext, rootNavigator: true).pop();
// تنفيذ الأمر بعد إغلاق الديالوج
Future.delayed(const Duration(milliseconds: 100), () {
onPressed();
});
},
confirmLabel: 'OK'.tr,
isDestructive: isDestructive,
),
],
),
),
),
),
);
}),
barrierDismissible: true,
barrierColor: _DC.barrierColor,
);
@@ -493,7 +503,12 @@ class MyDialogContent extends GetxController {
// ── Actions ───────────────────────────────────────────
_ActionRow(
onCancel: () => Get.back(),
onConfirm: onPressed,
onConfirm: () {
Get.back(); // Dismiss dialog first
WidgetsBinding.instance.addPostFrameCallback((_) {
onPressed();
});
},
confirmLabel: confirmLabel.tr,
isDestructive: isDestructive,
),