Initial commit

This commit is contained in:
Patrick Alvin Alcala 2025-11-12 12:46:45 +08:00
commit e5c20d673f
73 changed files with 2128 additions and 0 deletions

25
lib/main.dart Normal file
View file

@ -0,0 +1,25 @@
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:ocbo_esign_validator/pages/index_page.dart';
void main() {
runApp(const MyApp());
}
final _router = GoRouter(
initialLocation: '/',
routes: [GoRoute(name: 'index', path: '/', builder: (context, state) => const IndexPage())],
);
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp.router(
debugShowCheckedModeBanner: false,
theme: ThemeData(useMaterial3: true),
routerConfig: _router,
);
}
}

26
lib/pages/index_page.dart Normal file
View file

@ -0,0 +1,26 @@
import 'package:flutter/material.dart';
import 'package:gap/gap.dart';
import 'package:ocbo_esign_validator/widgets/image_widget.dart';
import 'package:ocbo_esign_validator/widgets/text_widget.dart';
class IndexPage extends StatelessWidget {
const IndexPage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: 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: Colors.black, bold: true, size: 32),
const Gap(2),
const TextWidget(text: "Mobile", color: Colors.black, bold: true),
],
),
),
);
}
}

View file

@ -0,0 +1,24 @@
import 'package:flutter/material.dart';
class ImageWidget extends StatelessWidget {
final String imagePath;
final double size;
final bool measureByHeight;
final bool? network;
const ImageWidget(
{super.key, required this.imagePath, required this.size, required this.measureByHeight, this.network});
@override
Widget build(BuildContext context) {
return (network == true)
? (measureByHeight)
? Image.network(imagePath,
height: size, cacheHeight: (size * MediaQuery.of(context).devicePixelRatio).round())
: Image.network(imagePath,
width: size, cacheWidth: (size * MediaQuery.of(context).devicePixelRatio).round())
: (measureByHeight)
? Image.asset(imagePath,
height: size, cacheHeight: (size * MediaQuery.of(context).devicePixelRatio).round())
: Image.asset(imagePath, width: size, cacheWidth: (size * MediaQuery.of(context).devicePixelRatio).round());
}
}

View file

@ -0,0 +1,30 @@
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
class TextWidget extends StatelessWidget {
final String text;
final double? size;
final double? opacity;
final bool? bold;
final bool? title;
final bool? underlined;
final Color? color;
const TextWidget(
{super.key, required this.text, this.size, this.opacity, this.bold, this.title, this.underlined, this.color});
@override
Widget build(BuildContext context) {
final textStyle = TextStyle(
color: color ?? Color.fromRGBO(255, 255, 255, opacity ?? 1),
fontSize: size ?? 28,
fontWeight: bold == true ? FontWeight.bold : FontWeight.normal,
decoration: underlined == true ? TextDecoration.underline : TextDecoration.none,
decorationColor: color ?? const Color.fromRGBO(255, 255, 255, 1),
decorationThickness: 1);
return title == true
? Text(text, style: GoogleFonts.outfit(textStyle: textStyle))
: Text(text, style: GoogleFonts.inter(textStyle: textStyle));
}
}