Compare commits

...

7 commits

47 changed files with 189 additions and 213 deletions

View file

@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application android:label="ocbo_esign_validator" android:name="${applicationName}" android:icon="@mipmap/ic_launcher">
<application android:label="ocbo_esign_validator" android:name="${applicationName}" android:icon="@mipmap/launcher_icon">
<activity android:name=".MainActivity" android:exported="true" android:launchMode="singleTop" android:taskAffinity="" android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user

Binary file not shown.

After

Width:  |  Height:  |  Size: 9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
assets/logo.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

BIN
assets/pat-alcala.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View file

@ -0,0 +1,34 @@
# flutter pub run flutter_launcher_icons
flutter_launcher_icons:
image_path: "assets/icon/icon.png"
android: "launcher_icon"
# image_path_android: "assets/icon/icon.png"
min_sdk_android: 21 # android min sdk min:16, default 21
# adaptive_icon_background: "assets/icon/background.png"
# adaptive_icon_foreground: "assets/icon/foreground.png"
# adaptive_icon_foreground_inset: 16
# adaptive_icon_monochrome: "assets/icon/monochrome.png"
ios: true
# image_path_ios: "assets/icon/icon.png"
remove_alpha_ios: true
# image_path_ios_dark_transparent: "assets/icon/icon_dark.png"
# image_path_ios_tinted_grayscale: "assets/icon/icon_tinted.png"
# desaturate_tinted_to_grayscale_ios: true
# background_color_ios: "#ffffff"
web:
generate: true
image_path: "path/to/image.png"
background_color: "#hexcode"
theme_color: "#hexcode"
windows:
generate: true
image_path: "path/to/image.png"
icon_size: 48 # min:48, max:256, default: 48
macos:
generate: true
image_path: "path/to/image.png"

View file

@ -427,7 +427,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = AppIcon;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
@ -484,7 +484,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = AppIcon;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";

View file

@ -1,122 +1 @@
{
"images" : [
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@2x.png",
"scale" : "2x"
},
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@3x.png",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@1x.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@3x.png",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-App-40x40@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-App-40x40@3x.png",
"scale" : "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-App-60x60@2x.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-App-60x60@3x.png",
"scale" : "3x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-App-20x20@1x.png",
"scale" : "1x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-App-20x20@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-App-29x29@1x.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-App-29x29@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-App-40x40@1x.png",
"scale" : "1x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-App-40x40@2x.png",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-App-76x76@1x.png",
"scale" : "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-App-76x76@2x.png",
"scale" : "2x"
},
{
"size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "Icon-App-83.5x83.5@2x.png",
"scale" : "2x"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "Icon-App-1024x1024@1x.png",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
{"images":[{"size":"20x20","idiom":"iphone","filename":"Icon-App-20x20@2x.png","scale":"2x"},{"size":"20x20","idiom":"iphone","filename":"Icon-App-20x20@3x.png","scale":"3x"},{"size":"29x29","idiom":"iphone","filename":"Icon-App-29x29@1x.png","scale":"1x"},{"size":"29x29","idiom":"iphone","filename":"Icon-App-29x29@2x.png","scale":"2x"},{"size":"29x29","idiom":"iphone","filename":"Icon-App-29x29@3x.png","scale":"3x"},{"size":"40x40","idiom":"iphone","filename":"Icon-App-40x40@2x.png","scale":"2x"},{"size":"40x40","idiom":"iphone","filename":"Icon-App-40x40@3x.png","scale":"3x"},{"size":"57x57","idiom":"iphone","filename":"Icon-App-57x57@1x.png","scale":"1x"},{"size":"57x57","idiom":"iphone","filename":"Icon-App-57x57@2x.png","scale":"2x"},{"size":"60x60","idiom":"iphone","filename":"Icon-App-60x60@2x.png","scale":"2x"},{"size":"60x60","idiom":"iphone","filename":"Icon-App-60x60@3x.png","scale":"3x"},{"size":"20x20","idiom":"ipad","filename":"Icon-App-20x20@1x.png","scale":"1x"},{"size":"20x20","idiom":"ipad","filename":"Icon-App-20x20@2x.png","scale":"2x"},{"size":"29x29","idiom":"ipad","filename":"Icon-App-29x29@1x.png","scale":"1x"},{"size":"29x29","idiom":"ipad","filename":"Icon-App-29x29@2x.png","scale":"2x"},{"size":"40x40","idiom":"ipad","filename":"Icon-App-40x40@1x.png","scale":"1x"},{"size":"40x40","idiom":"ipad","filename":"Icon-App-40x40@2x.png","scale":"2x"},{"size":"50x50","idiom":"ipad","filename":"Icon-App-50x50@1x.png","scale":"1x"},{"size":"50x50","idiom":"ipad","filename":"Icon-App-50x50@2x.png","scale":"2x"},{"size":"72x72","idiom":"ipad","filename":"Icon-App-72x72@1x.png","scale":"1x"},{"size":"72x72","idiom":"ipad","filename":"Icon-App-72x72@2x.png","scale":"2x"},{"size":"76x76","idiom":"ipad","filename":"Icon-App-76x76@1x.png","scale":"1x"},{"size":"76x76","idiom":"ipad","filename":"Icon-App-76x76@2x.png","scale":"2x"},{"size":"83.5x83.5","idiom":"ipad","filename":"Icon-App-83.5x83.5@2x.png","scale":"2x"},{"size":"1024x1024","idiom":"ios-marketing","filename":"Icon-App-1024x1024@1x.png","scale":"1x"}],"info":{"version":1,"author":"xcode"}}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 217 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 295 B

After

Width:  |  Height:  |  Size: 776 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 406 B

After

Width:  |  Height:  |  Size: 1.9 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 450 B

After

Width:  |  Height:  |  Size: 3.2 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 282 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 462 B

After

Width:  |  Height:  |  Size: 3.2 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 704 B

After

Width:  |  Height:  |  Size: 5.6 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 406 B

After

Width:  |  Height:  |  Size: 1.9 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 586 B

After

Width:  |  Height:  |  Size: 4.9 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 862 B

After

Width:  |  Height:  |  Size: 8.2 KiB

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 862 B

After

Width:  |  Height:  |  Size: 8.2 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 762 B

After

Width:  |  Height:  |  Size: 4.5 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Before After
Before After

View file

@ -1,7 +1,7 @@
import 'package:flutter/widgets.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:ocbo_esign_validator/blocs/user/user_bloc.dart';
import 'package:ocbo_esign_validator/blocs/user/user_event.dart';
import 'package:ocbo_esign_mobile/blocs/user/user_bloc.dart';
import 'package:ocbo_esign_mobile/blocs/user/user_event.dart';
Future<String> blocGetUser(BuildContext context) async {
try {

View file

@ -1,7 +1,7 @@
import 'package:flutter/widgets.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:ocbo_esign_validator/blocs/user/user_bloc.dart';
import 'package:ocbo_esign_validator/blocs/user/user_event.dart';
import 'package:ocbo_esign_mobile/blocs/user/user_bloc.dart';
import 'package:ocbo_esign_mobile/blocs/user/user_event.dart';
Future<bool> blocSetUser(BuildContext context, String value) async {
try {

View file

@ -1,6 +1,6 @@
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:ocbo_esign_validator/blocs/user/user_event.dart';
import 'package:ocbo_esign_validator/blocs/user/user_state.dart';
import 'package:ocbo_esign_mobile/blocs/user/user_event.dart';
import 'package:ocbo_esign_mobile/blocs/user/user_state.dart';
class UserBloc extends Bloc<UserEvent, UserState> {
UserBloc() : super(UserState('')) {

View file

@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:ocbo_esign_validator/widgets/text_widget.dart';
import 'package:ocbo_esign_mobile/widgets/text_widget.dart';
void showModal(BuildContext context, String title, String message, bool error) {
showDialog(

View file

@ -2,12 +2,12 @@ import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:go_router/go_router.dart';
import 'package:ocbo_esign_validator/blocs/user/user_bloc.dart';
import 'package:ocbo_esign_validator/pages/approval_page.dart';
import 'package:ocbo_esign_validator/pages/index_page.dart';
import 'package:ocbo_esign_validator/pages/login_page.dart';
import 'package:ocbo_esign_validator/pages/validate_page.dart';
import 'package:ocbo_esign_validator/pages/validation_result_page.dart';
import 'package:ocbo_esign_mobile/blocs/user/user_bloc.dart';
import 'package:ocbo_esign_mobile/pages/approval_page.dart';
import 'package:ocbo_esign_mobile/pages/index_page.dart';
import 'package:ocbo_esign_mobile/pages/login_page.dart';
import 'package:ocbo_esign_mobile/pages/validate_page.dart';
import 'package:ocbo_esign_mobile/pages/validation_result_page.dart';
Future<void> main() async {
await dotenv.load(fileName: ".env");

View file

@ -1,8 +1,8 @@
import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:ocbo_esign_validator/blocs/user/functions/bloc_getuser.dart';
import 'package:ocbo_esign_validator/widgets/image_widget.dart';
import 'package:ocbo_esign_validator/widgets/text_widget.dart';
import 'package:ocbo_esign_mobile/blocs/user/functions/bloc_getuser.dart';
import 'package:ocbo_esign_mobile/widgets/image_widget.dart';
import 'package:ocbo_esign_mobile/widgets/text_widget.dart';
class ApprovalPage extends StatefulWidget {
const ApprovalPage({super.key});
@ -41,10 +41,11 @@ class _ApprovalPageState extends State<ApprovalPage> {
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Color.fromRGBO(39, 26, 47, 1),
Color.fromRGBO(51, 34, 61, 1),
Color.fromRGBO(22, 33, 44, 1),
Color.fromRGBO(22, 33, 44, 1),
Color.fromRGBO(24, 45, 40, 1),
Color.fromRGBO(22, 33, 44, 1),
Color.fromRGBO(30, 56, 50, 1),
],
),
),

View file

@ -1,9 +1,9 @@
import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:go_router/go_router.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';
import 'package:ocbo_esign_mobile/widgets/image_widget.dart';
import 'package:ocbo_esign_mobile/widgets/menu_widget.dart';
import 'package:ocbo_esign_mobile/widgets/text_widget.dart';
class IndexPage extends StatelessWidget {
const IndexPage({super.key});
@ -32,10 +32,11 @@ class IndexPage extends StatelessWidget {
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Color.fromRGBO(39, 26, 47, 1),
Color.fromRGBO(51, 34, 61, 1),
Color.fromRGBO(22, 33, 44, 1),
Color.fromRGBO(22, 33, 44, 1),
Color.fromRGBO(24, 45, 40, 1),
Color.fromRGBO(22, 33, 44, 1),
Color.fromRGBO(30, 56, 50, 1),
],
),
),
@ -43,7 +44,7 @@ class IndexPage extends StatelessWidget {
child: Column(
children: [
const Gap(88),
const ImageWidget(imagePath: 'assets/logo.png', size: 140, measureByHeight: true),
const ImageWidget(imagePath: 'assets/logo.webp', size: 140, measureByHeight: false),
const Gap(24),
const TextWidget(
text: "OCBO e-Sign",
@ -60,7 +61,7 @@ class IndexPage extends StatelessWidget {
],
),
),
const MaxGap(200),
const Gap(184),
Row(
mainAxisAlignment: MainAxisAlignment.center,
spacing: 32,
@ -81,6 +82,16 @@ class IndexPage extends StatelessWidget {
),
],
),
const MaxGap(516),
const ImageWidget(imagePath: 'assets/pat-alcala.webp', size: 74, measureByHeight: false),
const Gap(4),
const TextWidget(
text: "Developed By: Pat Alcala",
color: Color.fromRGBO(244, 243, 243, 0.8),
bold: false,
size: 10,
),
const Gap(24),
],
),
),

View file

@ -5,14 +5,14 @@ import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:gap/gap.dart';
import 'package:go_router/go_router.dart';
import 'package:hashlib/hashlib.dart';
import 'package:ocbo_esign_validator/blocs/user/functions/bloc_setuser.dart';
import 'package:ocbo_esign_validator/functions/get_api.dart';
import 'package:ocbo_esign_validator/functions/modal.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';
import 'package:ocbo_esign_mobile/blocs/user/functions/bloc_setuser.dart';
import 'package:ocbo_esign_mobile/functions/get_api.dart';
import 'package:ocbo_esign_mobile/functions/modal.dart';
import 'package:ocbo_esign_mobile/widgets/box_widget.dart';
import 'package:ocbo_esign_mobile/widgets/button_widget.dart';
import 'package:ocbo_esign_mobile/widgets/image_widget.dart';
import 'package:ocbo_esign_mobile/widgets/input_widget.dart';
import 'package:ocbo_esign_mobile/widgets/text_widget.dart';
class LoginPage extends StatefulWidget {
const LoginPage({super.key});
@ -110,17 +110,18 @@ class _LoginPageState extends State<LoginPage> {
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Color.fromRGBO(39, 26, 47, 1),
Color.fromRGBO(51, 34, 61, 1),
Color.fromRGBO(22, 33, 44, 1),
Color.fromRGBO(22, 33, 44, 1),
Color.fromRGBO(24, 45, 40, 1),
Color.fromRGBO(22, 33, 44, 1),
Color.fromRGBO(30, 56, 50, 1),
],
),
),
child: Column(
children: [
const Gap(88),
const ImageWidget(imagePath: 'assets/logo.png', size: 100, measureByHeight: true),
const ImageWidget(imagePath: 'assets/logo.webp', size: 100, measureByHeight: true),
const Gap(58),
BoxWidget(
title: 'Login',

View file

@ -2,8 +2,9 @@ import 'package:flutter/material.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:gap/gap.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_mobile/functions/get_api.dart';
import 'package:ocbo_esign_mobile/widgets/box_widget.dart';
import 'package:ocbo_esign_mobile/widgets/text_widget.dart';
import 'package:vibration/vibration.dart';
class ValidatePage extends StatelessWidget {
@ -25,6 +26,23 @@ class BarcodeScannerScreen extends StatefulWidget {
class _BarcodeScannerScreenState extends State<BarcodeScannerScreen> {
late String qrResult = '';
void readQr(String value) async {
if (value.contains('OCBO e-Sign')) {
final response = await getApi('check-qr', value, null);
final result = response["result"];
if (result != '') {
setState(() {
qrResult = result;
});
}
} else {
setState(() {
qrResult = 'invalid';
});
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
@ -37,22 +55,23 @@ class _BarcodeScannerScreenState extends State<BarcodeScannerScreen> {
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Color.fromRGBO(39, 26, 47, 1),
Color.fromRGBO(51, 34, 61, 1),
Color.fromRGBO(22, 33, 44, 1),
Color.fromRGBO(22, 33, 44, 1),
Color.fromRGBO(24, 45, 40, 1),
Color.fromRGBO(22, 33, 44, 1),
Color.fromRGBO(30, 56, 50, 1),
],
),
),
child: Center(
child: Padding(
padding: const EdgeInsets.only(top: 70, left: 16, right: 16),
padding: const EdgeInsets.only(top: 64, left: 16, right: 16),
child: Column(
children: [
Container(
padding: EdgeInsets.only(top: 8, bottom: 8, left: 20, right: 20),
decoration: BoxDecoration(
color: const Color.fromRGBO(9, 13, 16, 0.623),
color: const Color.fromRGBO(9, 13, 16, 0.725),
borderRadius: BorderRadius.circular(32),
),
child: const TextWidget(text: 'Scan OCBO e-Sign QR Code', size: 14, bold: true),
@ -60,16 +79,17 @@ class _BarcodeScannerScreenState extends State<BarcodeScannerScreen> {
const Gap(24),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(24),
borderRadius: BorderRadius.circular(36),
border: BoxBorder.all(color: const Color.fromARGB(58, 227, 227, 227)),
boxShadow: [
const BoxShadow(
color: Color.fromRGBO(5, 5, 8, 0.341),
blurRadius: 8.0,
color: Color.fromRGBO(5, 5, 8, 0.526),
blurRadius: 6,
offset: Offset(4, 4), // left and up
),
const BoxShadow(
color: Color.fromRGBO(92, 71, 97, 0.373),
blurRadius: 8.0,
color: Color.fromRGBO(92, 71, 97, 0.526),
blurRadius: 6,
offset: Offset(-4, -4), // right and down
),
],
@ -77,15 +97,13 @@ class _BarcodeScannerScreenState extends State<BarcodeScannerScreen> {
height: 330,
width: 340,
child: ClipRRect(
borderRadius: BorderRadius.circular(24), // Adjust the radius as needed
borderRadius: BorderRadius.circular(36), // Adjust the radius as needed
child: MobileScanner(
fit: BoxFit.cover,
onDetect: (BarcodeCapture capture) async {
final List<Barcode> barcodes = capture.barcodes;
if (barcodes.isNotEmpty && barcodes.first.rawValue != null) {
setState(() {
qrResult = barcodes.first.rawValue!;
});
readQr(barcodes.first.rawValue!);
if (await Vibration.hasVibrator()) {
Vibration.vibrate(duration: 100);
@ -95,12 +113,11 @@ class _BarcodeScannerScreenState extends State<BarcodeScannerScreen> {
),
),
),
const Gap(40),
const Gap(24),
if (qrResult.isNotEmpty)
Padding(
padding: const EdgeInsets.only(left: 16, right: 16),
child: Column(
children: [
Column(
children: [
if (qrResult != 'invalid')
Row(
children: [
Container(
@ -109,17 +126,18 @@ class _BarcodeScannerScreenState extends State<BarcodeScannerScreen> {
height: 90,
decoration: BoxDecoration(
color: const Color.fromRGBO(69, 191, 73, 0.1),
border: Border.all(color: Color.fromRGBO(69, 191, 73, 1), width: 2),
border: Border.all(color: const Color.fromRGBO(69, 191, 73, 1), width: 2),
borderRadius: BorderRadius.circular(99), // Optional: rounded corners
),
child: Icon(Icons.thumb_up, color: const Color.fromRGBO(69, 191, 73, 1), size: 48),
child: Icon(Icons.check, color: const Color.fromRGBO(69, 191, 73, 1), size: 48),
),
const Gap(32),
const Gap(24),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const TextWidget(
text: 'Verified',
text: 'Valid',
bold: true,
size: 22,
color: Color.fromRGBO(69, 191, 73, 1),
@ -128,31 +146,62 @@ class _BarcodeScannerScreenState extends State<BarcodeScannerScreen> {
const TextWidget(
text: 'QR is a valid OCBO e-Sign',
bold: false,
size: 16,
size: 14,
color: Color.fromRGBO(69, 191, 73, 1),
),
],
),
const Gap(24),
BoxWidget(
title: '',
content: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const TextWidget(text: 'Name', bold: true, size: 14),
const Gap(8),
TextWidget(text: qrResult, bold: false, size: 14),
],
),
),
],
)
else
Row(
children: [
Container(
padding: EdgeInsets.all(0),
width: 90,
height: 90,
decoration: BoxDecoration(
color: const Color.fromRGBO(206, 74, 77, 0.1),
border: Border.all(color: const Color.fromRGBO(206, 74, 77, 1), width: 2),
borderRadius: BorderRadius.circular(99),
),
child: Icon(Icons.close, color: const Color.fromRGBO(206, 74, 77, 1), size: 48),
),
const Gap(24),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const TextWidget(
text: 'Invalid',
bold: true,
size: 22,
color: Color.fromRGBO(206, 74, 77, 1),
),
const Gap(16),
const TextWidget(
text: 'QR is a not valid OCBO e-Sign',
bold: false,
size: 14,
color: Color.fromRGBO(206, 74, 77, 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),
TextWidget(text: 'Role:', bold: true, size: 14),
const Gap(8),
TextWidget(text: 'APPROVER', bold: false, size: 14),
],
),
),
],
),
],
),
],
),

View file

@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:ocbo_esign_validator/widgets/text_widget.dart';
import 'package:ocbo_esign_mobile/widgets/text_widget.dart';
class BoxWidget extends StatelessWidget {
final String title;

View file

@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:ocbo_esign_validator/widgets/text_widget.dart';
import 'package:ocbo_esign_mobile/widgets/text_widget.dart';
class ButtonWidget extends StatelessWidget {
final String text;

View file

@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:ocbo_esign_validator/widgets/text_widget.dart';
import 'package:ocbo_esign_mobile/widgets/text_widget.dart';
class MenuWidget extends StatelessWidget {
final IconData? icon;

View file

@ -388,10 +388,10 @@ packages:
dependency: "direct main"
description:
name: mobile_scanner
sha256: "023a71afb4d7cfb5529d0f2636aa8b43db66257905b9486d702085989769c5f2"
sha256: c6184bf2913dd66be244108c9c27ca04b01caf726321c44b0e7a7a1e32d41044
url: "https://pub.dev"
source: hosted
version: "7.1.3"
version: "7.1.4"
nested:
dependency: transitive
description:

View file

@ -1,5 +1,5 @@
name: ocbo_esign_validator
description: "OCBO e-Sign Mobile Version"
name: ocbo_esign_mobile
description: "OCBO e-Sign Mobile version"
publish_to: "none" # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1
@ -42,4 +42,5 @@ flutter:
assets:
- .env
- assets/logo.png
- assets/logo.webp
- assets/pat-alcala.webp

View file

@ -8,7 +8,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:ocbo_esign_validator/main.dart';
import 'package:ocbo_esign_mobile/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {