Updated pages

This commit is contained in:
Patrick Alvin Alcala 2025-12-10 18:11:42 +08:00
parent 29a8324581
commit 78259a6f7e
2 changed files with 59 additions and 88 deletions

View file

@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:mobile_scanner/mobile_scanner.dart';
import 'package:ocbo_esign_validator/widgets/text_widget.dart';
@ -41,89 +42,41 @@ class _BarcodeScannerScreenState extends State<BarcodeScannerScreen> {
),
),
child: Center(
child: Column(
children: [
Expanded(
flex: 3,
child: MobileScanner(
onDetect: (BarcodeCapture capture) {
final List<Barcode> barcodes = capture.barcodes;
if (barcodes.isNotEmpty && barcodes.first.rawValue != null) {
setState(() {
barcodeResult = barcodes.first.rawValue!;
});
}
},
child: Padding(
padding: const EdgeInsets.only(top: 64, left: 16, right: 16),
child: Column(
children: [
Expanded(
flex: 2,
child: ClipRRect(
borderRadius: BorderRadius.circular(20), // Adjust the radius as needed
child: MobileScanner(
fit: BoxFit.cover,
onDetect: (BarcodeCapture capture) {
final List<Barcode> barcodes = capture.barcodes;
if (barcodes.isNotEmpty && barcodes.first.rawValue != null) {
setState(() {
barcodeResult = barcodes.first.rawValue!;
});
}
},
),
),
),
),
Expanded(
flex: 1,
child: Center(
child: Center(child: TextWidget(text: barcodeResult, bold: false, size: 18)),
Expanded(
flex: 2,
child: Column(
children: [
Gap(20),
TextWidget(text: 'Scan OCBO e-Sign QR', size: 20, bold: true),
],
),
),
),
],
],
),
),
),
),
);
}
}
// class ValidatePage extends StatefulWidget {
// const ValidatePage({super.key});
// @override
// State<ValidatePage> createState() => _ValidatePageState();
// }
// class _ValidatePageState extends State<ValidatePage> {
// final qrKey = GlobalKey(debugLabel: 'QR');
// String barcodeResult = "Point the camera at a barcode";
// @override
// Widget build(BuildContext context) {
// return Scaffold(
// resizeToAvoidBottomInset: false,
// body: Container(
// alignment: Alignment.center,
// height: MediaQuery.of(context).size.height,
// decoration: const BoxDecoration(
// gradient: LinearGradient(
// begin: Alignment.topCenter,
// end: Alignment.bottomCenter,
// colors: [
// Color.fromRGBO(39, 26, 47, 1),
// Color.fromRGBO(22, 33, 44, 1),
// Color.fromRGBO(22, 33, 44, 1),
// Color.fromRGBO(24, 45, 40, 1),
// ],
// ),
// ),
// child: Center(
// child: Column(
// children: [
// Expanded(
// flex: 2,
// child: MobileScanner(
// onDetect: (BarcodeCapture capture) {
// final List<Barcode> barcodes = capture.barcodes;
// if (barcodes.isNotEmpty && barcodes.first.rawValue != null) {
// setState(() {
// barcodeResult = barcodes.first.rawValue!;
// });
// }
// },
// ),
// ),
// Expanded(
// flex: 1,
// child: Center(child: TextWidget(text: barcodeResult, bold: false, size: 18)),
// ),
// ],
// ),
// ),
// ),
// );
// }
// }