Updated pages
This commit is contained in:
parent
b352c82f67
commit
4fdcc89c9d
4 changed files with 274 additions and 36 deletions
|
|
@ -1,10 +1,129 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:mobile_scanner/mobile_scanner.dart';
|
||||
import 'package:ocbo_esign_validator/widgets/text_widget.dart';
|
||||
|
||||
class ValidatePage extends StatelessWidget {
|
||||
const ValidatePage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold();
|
||||
return const MaterialApp(debugShowCheckedModeBanner: false, home: BarcodeScannerScreen());
|
||||
}
|
||||
}
|
||||
|
||||
class BarcodeScannerScreen extends StatefulWidget {
|
||||
const BarcodeScannerScreen({super.key});
|
||||
|
||||
@override
|
||||
State<BarcodeScannerScreen> createState() => _BarcodeScannerScreenState();
|
||||
}
|
||||
|
||||
class _BarcodeScannerScreenState extends State<BarcodeScannerScreen> {
|
||||
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: 3,
|
||||
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: Center(child: TextWidget(text: barcodeResult, bold: false, size: 18)),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// 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)),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue