Update: 2026-07-13 18:23:52

This commit is contained in:
Hamza-Ayed
2026-07-13 18:23:52 +03:00
parent 7bf6dc1be7
commit fd3f4a365a
23 changed files with 802 additions and 31 deletions
@@ -1777,4 +1777,19 @@ final Map<String, String> ar_jo = {
"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": "هذه الخدمة غير متوفرة حالياً في منطقتك",
"بطاقة الصعود (Boarding Pass)": "بطاقة الصعود (Boarding Pass)",
"بطاقة الصعود": "بطاقة الصعود",
"يرجى إبراز هذا الرمز للسائق عند الصعود للحافلة": "يرجى إبراز هذا الرمز للسائق عند الصعود للحافلة",
"مسافر موثق": "مسافر موثق",
"Now at": "الآن في",
"Scan": "مسح",
"Scan Passengers": "مسح الركاب",
"Manual Passenger List": "القائمة اليدوية",
"Manual List": "القائمة اليدوية",
"تم صعود الراكب بنجاح ✅": "تم صعود الراكب بنجاح ✅",
"فشل التحقق ❌": "فشل التحقق ❌",
"تم تسجيل حضور الراكب": "تم تسجيل حضور الراكب",
"فشل تسجيل الحضور": "فشل تسجيل الحضور",
"لا يوجد ركاب مسجلين في هذه المحطة": "لا يوجد ركاب مسجلين في هذه المحطة",
"حاضر": "حاضر",
};
@@ -8,6 +8,8 @@ import '../../constant/colors.dart';
import '../../constant/style.dart';
import '../../env/env.dart';
import '../../controller/transit/transit_controller.dart';
import 'transit_qr_code_page.dart';
import '../widgets/elevated_btn.dart';
// ── ألوان الصفحة ──────────────────────────────────────────────────────────────
Color get _bg =>
@@ -191,7 +193,7 @@ class _TransitMapPageState extends State<TransitMapPage> {
shape: BoxShape.circle,
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.12),
color: Colors.black.withValues(alpha: 0.12),
blurRadius: 10,
offset: const Offset(0, 3))
],
@@ -211,7 +213,7 @@ class _TransitMapPageState extends State<TransitMapPage> {
borderRadius: BorderRadius.circular(16),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.08),
color: Colors.black.withValues(alpha: 0.08),
blurRadius: 10,
offset: const Offset(0, 3))
],
@@ -263,7 +265,7 @@ class _TransitMapPageState extends State<TransitMapPage> {
shape: BoxShape.circle,
boxShadow: [
BoxShadow(
color: _accent.withOpacity(0.4),
color: _accent.withValues(alpha: 0.4),
blurRadius: 10,
offset: const Offset(0, 3))
],
@@ -353,7 +355,7 @@ class _TransitMapPageState extends State<TransitMapPage> {
borderRadius: BorderRadius.circular(14),
border: Border(right: BorderSide(color: color, width: 4)),
boxShadow: [
BoxShadow(color: Colors.black.withOpacity(0.08), blurRadius: 8)
BoxShadow(color: Colors.black.withValues(alpha: 0.08), blurRadius: 8)
],
),
child: Text(text,
@@ -390,7 +392,7 @@ class _InfoCard extends StatelessWidget {
borderRadius: BorderRadius.circular(20),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.12),
color: Colors.black.withValues(alpha: 0.12),
blurRadius: 20,
offset: const Offset(0, -4))
],
@@ -406,7 +408,7 @@ class _InfoCard extends StatelessWidget {
width: 44,
height: 44,
decoration: BoxDecoration(
color: _accent.withOpacity(0.12),
color: _accent.withValues(alpha: 0.12),
borderRadius: BorderRadius.circular(12),
),
child: const Icon(Icons.directions_bus_rounded,
@@ -476,7 +478,7 @@ class _InfoCard extends StatelessWidget {
borderRadius: BorderRadius.circular(4),
child: LinearProgressIndicator(
value: currentStopSeq! / totalStops,
backgroundColor: _accent.withOpacity(0.12),
backgroundColor: _accent.withValues(alpha: 0.12),
valueColor: const AlwaysStoppedAnimation<Color>(_accent),
minHeight: 6,
),
@@ -485,13 +487,28 @@ class _InfoCard extends StatelessWidget {
const SizedBox(height: 12),
// ── زر "بطاقة الصعود" (Boarding Pass) ─────────────────
SizedBox(
width: double.infinity,
height: 55,
child: MyElevatedButton(
onPressed: () {
Get.to(() => const TransitQRCodePage());
},
kolor: _accent,
title: 'بطاقة الصعود (Boarding Pass)'.tr,
),
),
const SizedBox(height: 8),
// ── زر "فاتك الباص؟" ─────────────────────────
SizedBox(
width: double.infinity,
child: OutlinedButton.icon(
onPressed: onMissedBus,
style: OutlinedButton.styleFrom(
side: BorderSide(color: _accent.withOpacity(0.5)),
side: BorderSide(color: _accent.withValues(alpha: 0.5)),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12)),
padding: const EdgeInsets.symmetric(vertical: 10),
@@ -0,0 +1,82 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:qr_flutter/qr_flutter.dart';
import '../../constant/colors.dart';
import '../../constant/style.dart';
import '../../constant/box_name.dart';
import '../../main.dart';
class TransitQRCodePage extends StatelessWidget {
const TransitQRCodePage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
final String passengerId = box.read(BoxName.passengerID) ?? '';
final String name = box.read(BoxName.name) ?? '';
// The payload for the QR Code
// You can later encrypt this or make it dynamic for security.
final String qrPayload = 'transit_board:$passengerId';
return Scaffold(
backgroundColor: AppColor.secondaryColor,
appBar: AppBar(
title: Text('بطاقة الصعود'.tr),
backgroundColor: AppColor.secondaryColor,
elevation: 0,
foregroundColor: AppColor.writeColor,
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'يرجى إبراز هذا الرمز للسائق عند الصعود للحافلة'.tr,
textAlign: TextAlign.center,
style: AppStyle.title.copyWith(color: AppColor.grayColor),
),
const SizedBox(height: 30),
Container(
padding: const EdgeInsets.all(20),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.1),
blurRadius: 10,
spreadRadius: 2,
),
],
),
child: Column(
children: [
QrImageView(
data: qrPayload,
version: QrVersions.auto,
size: 250.0,
foregroundColor: Colors.black,
),
const SizedBox(height: 20),
Text(
name,
style: AppStyle.headTitle2,
),
const SizedBox(height: 5),
Text(
'مسافر موثق',
style: AppStyle.title.copyWith(
color: AppColor.greenColor,
fontWeight: FontWeight.w600,
),
),
],
),
),
],
),
),
);
}
}
+16
View File
@@ -1572,6 +1572,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.5.0"
qr:
dependency: transitive
description:
name: qr
sha256: "5a1d2586170e172b8a8c8470bbbffd5eb0cd38a66c0d77155ea138d3af3a4445"
url: "https://pub.dev"
source: hosted
version: "3.0.2"
qr_flutter:
dependency: "direct main"
description:
name: qr_flutter
sha256: "5095f0fc6e3f71d08adef8feccc8cea4f12eec18a2e31c2e8d82cb6019f4b097"
url: "https://pub.dev"
source: hosted
version: "4.1.0"
quick_actions:
dependency: "direct main"
description:
+1
View File
@@ -58,6 +58,7 @@ dependencies:
webview_flutter: ^4.9.0
webview_flutter_android: ^3.16.2
webview_flutter_wkwebview: ^3.14.0
qr_flutter: ^4.1.0
just_audio: ^0.10.5
firebase_auth: ^6.1.4
device_info_plus: 12.3.0