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
@@ -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,
),
),
],
),
),
],
),
),
);
}
}