Updated pages
This commit is contained in:
parent
2bd32df8fd
commit
cbb142b0cf
2 changed files with 91 additions and 27 deletions
|
|
@ -53,14 +53,14 @@ class IndexPage extends StatelessWidget {
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.only(right: (screenWidth / 2) - 100),
|
padding: EdgeInsets.only(right: (screenWidth / 2) - 100),
|
||||||
child: Row(
|
child: const Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: [
|
children: [
|
||||||
TextWidget(text: "Mobile", color: Color.fromARGB(255, 244, 243, 243), bold: false, size: 16),
|
TextWidget(text: "Mobile", color: Color.fromARGB(255, 244, 243, 243), bold: false, size: 16),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Gap(200),
|
const MaxGap(200),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
spacing: 32,
|
spacing: 32,
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,10 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||||
import 'package:gap/gap.dart';
|
import 'package:gap/gap.dart';
|
||||||
import 'package:mobile_scanner/mobile_scanner.dart';
|
import 'package:mobile_scanner/mobile_scanner.dart';
|
||||||
|
import 'package:ocbo_esign_validator/widgets/box_widget.dart';
|
||||||
import 'package:ocbo_esign_validator/widgets/text_widget.dart';
|
import 'package:ocbo_esign_validator/widgets/text_widget.dart';
|
||||||
|
import 'package:vibration/vibration.dart';
|
||||||
|
|
||||||
class ValidatePage extends StatelessWidget {
|
class ValidatePage extends StatelessWidget {
|
||||||
const ValidatePage({super.key});
|
const ValidatePage({super.key});
|
||||||
|
|
@ -43,53 +46,114 @@ class _BarcodeScannerScreenState extends State<BarcodeScannerScreen> {
|
||||||
),
|
),
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(top: 88, left: 16, right: 16),
|
padding: const EdgeInsets.only(top: 70, left: 16, right: 16),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.only(top: 8, bottom: 8, left: 20, right: 20),
|
padding: EdgeInsets.only(top: 8, bottom: 8, left: 20, right: 20),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Color.fromARGB(149, 16, 22, 28),
|
color: const Color.fromRGBO(9, 13, 16, 0.623),
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(32),
|
||||||
),
|
),
|
||||||
child: TextWidget(text: 'Scan OCBO e-Sign QR Code', size: 14, bold: true),
|
child: const TextWidget(text: 'Scan OCBO e-Sign QR Code', size: 14, bold: true),
|
||||||
),
|
),
|
||||||
const Gap(50),
|
const Gap(24),
|
||||||
SizedBox(
|
Container(
|
||||||
height: 350,
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(24),
|
||||||
|
boxShadow: [
|
||||||
|
const BoxShadow(
|
||||||
|
color: Color.fromRGBO(5, 5, 8, 0.341),
|
||||||
|
blurRadius: 8.0,
|
||||||
|
offset: Offset(4, 4), // left and up
|
||||||
|
),
|
||||||
|
const BoxShadow(
|
||||||
|
color: Color.fromRGBO(92, 71, 97, 0.373),
|
||||||
|
blurRadius: 8.0,
|
||||||
|
offset: Offset(-4, -4), // right and down
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
height: 330,
|
||||||
|
width: 340,
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius: BorderRadius.circular(20), // Adjust the radius as needed
|
borderRadius: BorderRadius.circular(24), // Adjust the radius as needed
|
||||||
child: MobileScanner(
|
child: MobileScanner(
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
onDetect: (BarcodeCapture capture) {
|
onDetect: (BarcodeCapture capture) async {
|
||||||
final List<Barcode> barcodes = capture.barcodes;
|
final List<Barcode> barcodes = capture.barcodes;
|
||||||
if (barcodes.isNotEmpty && barcodes.first.rawValue != null) {
|
if (barcodes.isNotEmpty && barcodes.first.rawValue != null) {
|
||||||
setState(() {
|
setState(() {
|
||||||
qrResult = barcodes.first.rawValue!;
|
qrResult = barcodes.first.rawValue!;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (await Vibration.hasVibrator()) {
|
||||||
|
Vibration.vibrate(duration: 100);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const Gap(40),
|
const Gap(40),
|
||||||
|
if (qrResult.isNotEmpty)
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 16, right: 16),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.all(0),
|
padding: EdgeInsets.all(0),
|
||||||
width: 120,
|
width: 90,
|
||||||
height: 120,
|
height: 90,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
border: Border.all(
|
color: const Color.fromRGBO(69, 191, 73, 0.1),
|
||||||
color: Color.fromRGBO(59, 169, 62, 1),
|
border: Border.all(color: Color.fromRGBO(69, 191, 73, 1), width: 2),
|
||||||
width: 2,
|
|
||||||
), // Background color of the container
|
|
||||||
borderRadius: BorderRadius.circular(99), // Optional: rounded corners
|
borderRadius: BorderRadius.circular(99), // Optional: rounded corners
|
||||||
),
|
),
|
||||||
child: Icon(Icons.thumb_up, color: const Color.fromRGBO(59, 169, 62, 1), size: 80),
|
child: Icon(Icons.thumb_up, color: const Color.fromRGBO(69, 191, 73, 1), size: 48),
|
||||||
|
),
|
||||||
|
const Gap(32),
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
const TextWidget(
|
||||||
|
text: 'Verified',
|
||||||
|
bold: true,
|
||||||
|
size: 22,
|
||||||
|
color: Color.fromRGBO(69, 191, 73, 1),
|
||||||
),
|
),
|
||||||
const Gap(16),
|
const Gap(16),
|
||||||
const TextWidget(text: 'Verified', size: 20, bold: true, color: Color.fromRGBO(59, 169, 62, 1)),
|
const TextWidget(
|
||||||
|
text: 'QR is a valid OCBO e-Sign',
|
||||||
|
bold: false,
|
||||||
|
size: 16,
|
||||||
|
color: Color.fromRGBO(69, 191, 73, 1),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const Gap(32),
|
||||||
|
BoxWidget(
|
||||||
|
title: '',
|
||||||
|
content: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
TextWidget(text: 'Name', bold: true, size: 14),
|
||||||
|
const Gap(8),
|
||||||
|
TextWidget(text: dotenv.env['HEAD']!, bold: false, size: 14),
|
||||||
const Gap(16),
|
const Gap(16),
|
||||||
TextWidget(text: qrResult, size: 20, bold: true),
|
TextWidget(text: 'Role:', bold: true, size: 14),
|
||||||
|
const Gap(8),
|
||||||
|
TextWidget(text: 'APPROVER', bold: false, size: 14),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue