Updated pages

This commit is contained in:
Patrick Alvin Alcala 2025-12-10 12:43:38 +08:00
parent b352c82f67
commit 4fdcc89c9d
4 changed files with 274 additions and 36 deletions

View file

@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:go_router/go_router.dart';
import 'package:ocbo_esign_validator/widgets/circle_widget.dart';
import 'package:ocbo_esign_validator/widgets/menu_widget.dart';
import 'package:ocbo_esign_validator/widgets/image_widget.dart';
import 'package:ocbo_esign_validator/widgets/text_widget.dart';
@ -11,7 +11,7 @@ class IndexPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
void gotoApproval() {
context.push('/approval');
context.push('/login');
}
void gotoValidation() {
@ -20,43 +20,72 @@ class IndexPage extends StatelessWidget {
return Scaffold(
resizeToAvoidBottomInset: false,
body: Container(
alignment: Alignment.center,
height: MediaQuery.of(context).size.height,
decoration: const BoxDecoration(color: Color.fromRGBO(21, 31, 42, 1)),
child: Center(
child: Column(
children: [
const Gap(88),
const ImageWidget(imagePath: 'assets/logo.png', size: 140, measureByHeight: true),
const Gap(20),
const TextWidget(text: "OCBO e-Sign", color: Color.fromARGB(255, 244, 243, 243), bold: true, size: 32),
const Gap(2),
const TextWidget(text: "Mobile", color: Color.fromARGB(255, 244, 243, 243), bold: true),
const Gap(200),
Row(
mainAxisAlignment: MainAxisAlignment.center,
spacing: 32,
children: <Widget>[
CircleWidget(
icon: Icons.thumb_up,
text: 'Approval',
onPressed: () {
gotoApproval();
},
body: LayoutBuilder(
builder: (context, constraints) {
final screenWidth = constraints.maxWidth;
return 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: [
const Gap(88),
const ImageWidget(imagePath: 'assets/logo.png', size: 140, measureByHeight: true),
const Gap(24),
const TextWidget(
text: "OCBO e-Sign",
color: Color.fromARGB(255, 244, 243, 243),
bold: true,
size: 34,
),
CircleWidget(
icon: Icons.qr_code,
text: 'Validate',
onPressed: () {
gotoValidation();
},
Padding(
padding: EdgeInsets.only(right: (screenWidth / 2) - 100),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
TextWidget(text: "Mobile", color: Color.fromARGB(255, 244, 243, 243), bold: false, size: 16),
],
),
),
Gap(200),
Row(
mainAxisAlignment: MainAxisAlignment.center,
spacing: 32,
children: <Widget>[
MenuWidget(
icon: Icons.person,
text: 'Login',
onPressed: () {
gotoApproval();
},
),
MenuWidget(
icon: Icons.qr_code,
text: 'Validate',
onPressed: () {
gotoValidation();
},
),
],
),
],
),
],
),
),
),
);
},
),
);
}

80
lib/pages/login_page.dart Normal file
View file

@ -0,0 +1,80 @@
import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:ocbo_esign_validator/widgets/box_widget.dart';
import 'package:ocbo_esign_validator/widgets/button_widget.dart';
import 'package:ocbo_esign_validator/widgets/image_widget.dart';
import 'package:ocbo_esign_validator/widgets/input_widget.dart';
import 'package:ocbo_esign_validator/widgets/text_widget.dart';
class LoginPage extends StatefulWidget {
const LoginPage({super.key});
@override
State<LoginPage> createState() => _LoginPageState();
}
class _LoginPageState extends State<LoginPage> {
// final List _ =;
// ["Cluj-Napoca", "Bucuresti", "Timisoara", "Brasov", "Constanta"];
final _passwordController = TextEditingController();
final _approver = "ARCH. KHASHAYAR L. TOGHYANI";
void _login() {
// Add your login logic here
print("Login button clicked");
}
@override
void dispose() {
_passwordController.dispose();
super.dispose();
}
@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: Column(
children: [
const Gap(88),
const ImageWidget(imagePath: 'assets/logo.png', size: 100, measureByHeight: true),
const Gap(50),
BoxWidget(
title: 'Login',
content: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const TextWidget(text: 'Name', bold: true, size: 16),
const Gap(8),
TextWidget(text: _approver, bold: false, size: 16),
const Gap(8),
const TextWidget(text: 'Password', bold: true, size: 16),
const Gap(8),
InputWidget(controller: _passwordController, placeholder: 'placeholder'),
const Gap(16),
ButtonWidget(text: 'Login', onPressed: _login),
],
),
),
],
),
),
);
}
}

View file

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

View file

@ -0,0 +1,10 @@
import 'package:flutter/material.dart';
class ValidationResultPage extends StatelessWidget {
const ValidationResultPage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold();
}
}