Updated pages
This commit is contained in:
parent
29a8324581
commit
78259a6f7e
2 changed files with 59 additions and 88 deletions
|
|
@ -14,20 +14,29 @@ class LoginPage extends StatefulWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
class _LoginPageState extends State<LoginPage> {
|
class _LoginPageState extends State<LoginPage> {
|
||||||
// final List _ =;
|
|
||||||
// ["Cluj-Napoca", "Bucuresti", "Timisoara", "Brasov", "Constanta"];
|
|
||||||
|
|
||||||
final _passwordController = TextEditingController();
|
final _passwordController = TextEditingController();
|
||||||
final _approver = "ARCH. KHASHAYAR L. TOGHYANI";
|
final _approver = "ARCH. KHASHAYAR L. TOGHYANI";
|
||||||
|
late ValueNotifier<String> passwordNotifier;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
passwordNotifier = ValueNotifier(_passwordController.text);
|
||||||
|
_passwordController.addListener(() {
|
||||||
|
passwordNotifier.value = _passwordController.text;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
void _login() {
|
void _login() {
|
||||||
// Add your login logic here
|
debugPrint("Login button clicked");
|
||||||
print("Login button clicked");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _ignoreButton() {}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
_passwordController.dispose();
|
_passwordController.dispose();
|
||||||
|
passwordNotifier.dispose();
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -54,7 +63,7 @@ class _LoginPageState extends State<LoginPage> {
|
||||||
children: [
|
children: [
|
||||||
const Gap(88),
|
const Gap(88),
|
||||||
const ImageWidget(imagePath: 'assets/logo.png', size: 100, measureByHeight: true),
|
const ImageWidget(imagePath: 'assets/logo.png', size: 100, measureByHeight: true),
|
||||||
const Gap(50),
|
const Gap(58),
|
||||||
BoxWidget(
|
BoxWidget(
|
||||||
title: 'Login',
|
title: 'Login',
|
||||||
content: Column(
|
content: Column(
|
||||||
|
|
@ -63,12 +72,21 @@ class _LoginPageState extends State<LoginPage> {
|
||||||
const TextWidget(text: 'Name', bold: true, size: 16),
|
const TextWidget(text: 'Name', bold: true, size: 16),
|
||||||
const Gap(8),
|
const Gap(8),
|
||||||
TextWidget(text: _approver, bold: false, size: 16),
|
TextWidget(text: _approver, bold: false, size: 16),
|
||||||
const Gap(8),
|
const Gap(16),
|
||||||
const TextWidget(text: 'Password', bold: true, size: 16),
|
const TextWidget(text: 'Password', bold: true, size: 16),
|
||||||
const Gap(8),
|
const Gap(8),
|
||||||
InputWidget(controller: _passwordController, placeholder: 'placeholder'),
|
InputWidget(controller: _passwordController, password: true),
|
||||||
const Gap(16),
|
const Gap(24),
|
||||||
ButtonWidget(text: 'Login', onPressed: _login),
|
ValueListenableBuilder<String>(
|
||||||
|
valueListenable: passwordNotifier,
|
||||||
|
builder: (context, password, child) {
|
||||||
|
return ButtonWidget(
|
||||||
|
text: password.isNotEmpty ? 'Login' : 'Required password',
|
||||||
|
onPressed: password.isNotEmpty ? _login : _ignoreButton,
|
||||||
|
disabled: password.isEmpty,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.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/text_widget.dart';
|
import 'package:ocbo_esign_validator/widgets/text_widget.dart';
|
||||||
|
|
||||||
|
|
@ -41,11 +42,16 @@ class _BarcodeScannerScreenState extends State<BarcodeScannerScreen> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Center(
|
child: Center(
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.only(top: 64, left: 16, right: 16),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 3,
|
flex: 2,
|
||||||
|
child: ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(20), // Adjust the radius as needed
|
||||||
child: MobileScanner(
|
child: MobileScanner(
|
||||||
|
fit: BoxFit.cover,
|
||||||
onDetect: (BarcodeCapture capture) {
|
onDetect: (BarcodeCapture capture) {
|
||||||
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) {
|
||||||
|
|
@ -56,74 +62,21 @@ class _BarcodeScannerScreenState extends State<BarcodeScannerScreen> {
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 1,
|
flex: 2,
|
||||||
child: Center(
|
child: Column(
|
||||||
child: Center(child: TextWidget(text: barcodeResult, bold: false, size: 18)),
|
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)),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue