This commit is contained in:
Patrick Alvin Alcala 2025-02-27 13:36:14 +08:00
parent a56ed92863
commit bda39a56d0
12 changed files with 144 additions and 105 deletions

View file

@ -2,6 +2,8 @@ import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:gap/gap.dart';
import 'package:pharmacy_mobile/widgets/button_widget.dart';
import 'package:pharmacy_mobile/widgets/image_widget.dart';
import 'package:pharmacy_mobile/widgets/logo_widget.dart';
import 'package:pharmacy_mobile/widgets/page_background_widget.dart';
import 'package:pharmacy_mobile/widgets/slogan_widget.dart';
import 'package:pharmacy_mobile/widgets/text_widget.dart';
@ -34,8 +36,7 @@ class IndexPage extends StatelessWidget {
const Gap(32),
Padding(
padding: const EdgeInsets.fromLTRB(0, 0, 38, 0),
child: Image.asset('assets/ph_logo.webp',
width: 192, cacheWidth: (192 * MediaQuery.of(context).devicePixelRatio).round()),
child: const ImageWidget(imagePath: 'assets/ph_logo.webp', size: 192, measureByHeight: false),
),
const Gap(64),
ButtonWidget(text: 'Login', onPressed: gotoLogin),
@ -45,10 +46,23 @@ class IndexPage extends StatelessWidget {
const SloganWidget(),
const Gap(32),
const MaxGap(500),
const TextWidget(
text: 'Copyright © 2025 - Ofelia Franco-Alcala Pharmacy',
size: 10,
bold: true,
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const TextWidget(
text: 'Copyright © 2025 -',
size: 10,
bold: true,
),
const Gap(4),
const LogoWidget(size: 28),
const Gap(4),
const TextWidget(
text: 'Ofelia Franco-Alcala Pharmacy',
size: 10,
bold: true,
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
@ -59,8 +73,11 @@ class IndexPage extends StatelessWidget {
opacity: 0.8,
),
const Gap(4),
Image.asset('assets/pat-alcala_logo.webp',
height: 12, cacheHeight: (12 * MediaQuery.of(context).devicePixelRatio).round()),
const ImageWidget(
imagePath: 'assets/pat-alcala_logo.webp',
size: 16,
measureByHeight: true,
),
const Gap(4),
const TextWidget(
text: 'Pat Alcala',

View file

@ -0,0 +1,15 @@
import 'package:flutter/material.dart';
class ImageWidget extends StatelessWidget {
final String imagePath;
final double size;
final bool measureByHeight;
const ImageWidget({super.key, required this.imagePath, required this.size, required this.measureByHeight});
@override
Widget build(BuildContext context) {
return (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());
}
}