83 lines
2.6 KiB
Dart
83 lines
2.6 KiB
Dart
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,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|