update
This commit is contained in:
parent
50d2cba7f2
commit
7fca1e79a8
9 changed files with 53 additions and 23 deletions
BIN
assets/background.png
Normal file
BIN
assets/background.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 524 KiB |
BIN
assets/background.webp
Normal file
BIN
assets/background.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 43 KiB |
|
|
@ -33,9 +33,9 @@ class IndexPage extends StatelessWidget {
|
|||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(0, 0, 16, 0),
|
||||
child: Image.asset('assets/ph_logo.webp',
|
||||
width: 200, cacheWidth: (200 * MediaQuery.of(context).devicePixelRatio).round()),
|
||||
width: 160, cacheWidth: (160 * MediaQuery.of(context).devicePixelRatio).round()),
|
||||
),
|
||||
const Gap(32),
|
||||
const Gap(64),
|
||||
ButtonWidget(text: 'Login', onPressed: gotoLogin),
|
||||
const Gap(8),
|
||||
ButtonWidget(text: 'Register', onPressed: gotoRegister, outline: true),
|
||||
|
|
|
|||
|
|
@ -93,12 +93,11 @@ class _LoginPageState extends State<LoginPage> {
|
|||
child: Container(
|
||||
padding: EdgeInsets.fromLTRB(32, 32, 32, 40),
|
||||
decoration: BoxDecoration(
|
||||
// color: const Color.fromRGBO(38, 17, 46, 0.859),
|
||||
color: const Color.fromRGBO(57, 38, 62, 0.9),
|
||||
color: const Color.fromRGBO(57, 38, 62, 0.6),
|
||||
borderRadius: BorderRadius.all(Radius.circular(16)),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: const Color.fromRGBO(0, 0, 0, 0.4), // Subtle shadow to give depth
|
||||
color: const Color.fromRGBO(0, 0, 0, 0.2), // Subtle shadow to give depth
|
||||
spreadRadius: 0,
|
||||
blurRadius: 4,
|
||||
offset: Offset(0, 2),
|
||||
|
|
|
|||
|
|
@ -41,31 +41,35 @@ class MainPage extends StatelessWidget {
|
|||
const TextWidget(text: 'Menu'),
|
||||
const Gap(16),
|
||||
MenuWidget(
|
||||
icon: FontAwesomeIcons.squarePlus,
|
||||
text: 'Add Medicine',
|
||||
onPressed: gotoAddMedicine,
|
||||
),
|
||||
icon: FontAwesomeIcons.squarePlus,
|
||||
text: 'Add Medicine',
|
||||
onPressed: gotoAddMedicine,
|
||||
color: 'green'),
|
||||
const Gap(16),
|
||||
MenuWidget(
|
||||
icon: FontAwesomeIcons.squarePlus,
|
||||
text: 'Add Generics',
|
||||
onPressed: gotoAddGenerics,
|
||||
),
|
||||
icon: FontAwesomeIcons.squarePlus,
|
||||
text: 'Add Generics',
|
||||
onPressed: gotoAddGenerics,
|
||||
color: 'green'),
|
||||
const Gap(16),
|
||||
MenuWidget(
|
||||
icon: FontAwesomeIcons.squarePlus, text: 'Add Stock', onPressed: () => {context.push('/addstock')}),
|
||||
icon: FontAwesomeIcons.squarePlus,
|
||||
text: 'Add Stock',
|
||||
onPressed: () => {context.push('/addstock')},
|
||||
color: 'green'),
|
||||
const Gap(16),
|
||||
MenuWidget(
|
||||
icon: FontAwesomeIcons.squarePlus,
|
||||
text: 'Add Medicine Type',
|
||||
onPressed: () => {context.push('/addtype')}),
|
||||
onPressed: () => {context.push('/addtype')},
|
||||
color: 'green'),
|
||||
const Gap(32),
|
||||
MenuWidget(
|
||||
icon: FontAwesomeIcons.listCheck,
|
||||
text: 'List of Stocks',
|
||||
onPressed: () => {context.push('/liststocks')}),
|
||||
onPressed: () => {context.push('/liststocks')},
|
||||
color: 'yellow'),
|
||||
const Gap(40),
|
||||
// TextButton(onPressed: () => {_signOut()}, child: const Text('Logout')),
|
||||
ButtonWidget(
|
||||
text: 'Logout',
|
||||
onPressed: signOut,
|
||||
|
|
|
|||
|
|
@ -75,11 +75,11 @@ class _RegisterPageState extends State<RegisterPage> {
|
|||
child: Container(
|
||||
padding: EdgeInsets.fromLTRB(32, 32, 32, 40),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color.fromRGBO(57, 38, 62, 0.9),
|
||||
color: const Color.fromRGBO(57, 38, 62, 0.6),
|
||||
borderRadius: BorderRadius.all(Radius.circular(16)),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: const Color.fromRGBO(0, 0, 0, 0.4), // Subtle shadow to give depth
|
||||
color: const Color.fromRGBO(0, 0, 0, 0.2), // Subtle shadow to give depth
|
||||
spreadRadius: 0,
|
||||
blurRadius: 4,
|
||||
offset: Offset(0, 2),
|
||||
|
|
|
|||
|
|
@ -1,15 +1,20 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
// import 'package:pharmacy_mobile/widgets/text_widget.dart';
|
||||
|
||||
class MenuWidget extends StatelessWidget {
|
||||
final String text;
|
||||
final IconData? icon;
|
||||
final VoidCallback? onPressed;
|
||||
final Color? borderColor;
|
||||
final String? color;
|
||||
|
||||
const MenuWidget({super.key, required this.text, this.icon, this.onPressed, this.borderColor});
|
||||
final Color green = const Color.fromRGBO(58, 236, 27, 0.2);
|
||||
final Color blue = const Color.fromRGBO(27, 90, 236, 0.2);
|
||||
final Color red = const Color.fromRGBO(236, 27, 27, 0.2);
|
||||
final Color yellow = const Color.fromRGBO(236, 232, 27, 0.2);
|
||||
final Color teal = const Color.fromRGBO(27, 236, 229, 0.2);
|
||||
|
||||
const MenuWidget({super.key, required this.text, this.icon, this.onPressed, this.color});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
|
@ -20,7 +25,10 @@ class MenuWidget extends StatelessWidget {
|
|||
padding: EdgeInsets.only(top: 16, bottom: 16),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
border: Border.all(color: borderColor ?? const Color.fromARGB(255, 255, 255, 255), width: 2),
|
||||
border: Border.all(
|
||||
color: color != null ? _getColorBasedOnString(color ?? '') : const Color.fromRGBO(255, 255, 255, 0.6),
|
||||
width: 2),
|
||||
color: color != null ? _getColorBasedOnString(color ?? '') : Colors.transparent,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
|
|
@ -39,4 +47,21 @@ class MenuWidget extends StatelessWidget {
|
|||
),
|
||||
);
|
||||
}
|
||||
|
||||
Color _getColorBasedOnString(String color) {
|
||||
switch (color.toLowerCase()) {
|
||||
case 'green':
|
||||
return green;
|
||||
case 'blue':
|
||||
return blue;
|
||||
case 'red':
|
||||
return red;
|
||||
case 'yellow':
|
||||
return yellow;
|
||||
case 'teal':
|
||||
return teal;
|
||||
default:
|
||||
return Colors.transparent; // Default to transparent if color is not recognized
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ class PageBackgroundWidget extends StatelessWidget {
|
|||
alignment: Alignment.center,
|
||||
height: MediaQuery.of(context).size.height,
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(image: AssetImage('assets/background.webp'), fit: BoxFit.cover, opacity: 0.1),
|
||||
gradient: RadialGradient(
|
||||
tileMode: TileMode.clamp,
|
||||
colors: [
|
||||
|
|
|
|||
|
|
@ -32,3 +32,4 @@ flutter:
|
|||
|
||||
assets:
|
||||
- assets/ph_logo.webp
|
||||
- assets/background.webp
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue