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(
|
||||||
padding: const EdgeInsets.fromLTRB(0, 0, 16, 0),
|
padding: const EdgeInsets.fromLTRB(0, 0, 16, 0),
|
||||||
child: Image.asset('assets/ph_logo.webp',
|
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),
|
ButtonWidget(text: 'Login', onPressed: gotoLogin),
|
||||||
const Gap(8),
|
const Gap(8),
|
||||||
ButtonWidget(text: 'Register', onPressed: gotoRegister, outline: true),
|
ButtonWidget(text: 'Register', onPressed: gotoRegister, outline: true),
|
||||||
|
|
|
||||||
|
|
@ -93,12 +93,11 @@ class _LoginPageState extends State<LoginPage> {
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: EdgeInsets.fromLTRB(32, 32, 32, 40),
|
padding: EdgeInsets.fromLTRB(32, 32, 32, 40),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
// color: const Color.fromRGBO(38, 17, 46, 0.859),
|
color: const Color.fromRGBO(57, 38, 62, 0.6),
|
||||||
color: const Color.fromRGBO(57, 38, 62, 0.9),
|
|
||||||
borderRadius: BorderRadius.all(Radius.circular(16)),
|
borderRadius: BorderRadius.all(Radius.circular(16)),
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
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,
|
spreadRadius: 0,
|
||||||
blurRadius: 4,
|
blurRadius: 4,
|
||||||
offset: Offset(0, 2),
|
offset: Offset(0, 2),
|
||||||
|
|
|
||||||
|
|
@ -44,28 +44,32 @@ class MainPage extends StatelessWidget {
|
||||||
icon: FontAwesomeIcons.squarePlus,
|
icon: FontAwesomeIcons.squarePlus,
|
||||||
text: 'Add Medicine',
|
text: 'Add Medicine',
|
||||||
onPressed: gotoAddMedicine,
|
onPressed: gotoAddMedicine,
|
||||||
),
|
color: 'green'),
|
||||||
const Gap(16),
|
const Gap(16),
|
||||||
MenuWidget(
|
MenuWidget(
|
||||||
icon: FontAwesomeIcons.squarePlus,
|
icon: FontAwesomeIcons.squarePlus,
|
||||||
text: 'Add Generics',
|
text: 'Add Generics',
|
||||||
onPressed: gotoAddGenerics,
|
onPressed: gotoAddGenerics,
|
||||||
),
|
color: 'green'),
|
||||||
const Gap(16),
|
const Gap(16),
|
||||||
MenuWidget(
|
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),
|
const Gap(16),
|
||||||
MenuWidget(
|
MenuWidget(
|
||||||
icon: FontAwesomeIcons.squarePlus,
|
icon: FontAwesomeIcons.squarePlus,
|
||||||
text: 'Add Medicine Type',
|
text: 'Add Medicine Type',
|
||||||
onPressed: () => {context.push('/addtype')}),
|
onPressed: () => {context.push('/addtype')},
|
||||||
|
color: 'green'),
|
||||||
const Gap(32),
|
const Gap(32),
|
||||||
MenuWidget(
|
MenuWidget(
|
||||||
icon: FontAwesomeIcons.listCheck,
|
icon: FontAwesomeIcons.listCheck,
|
||||||
text: 'List of Stocks',
|
text: 'List of Stocks',
|
||||||
onPressed: () => {context.push('/liststocks')}),
|
onPressed: () => {context.push('/liststocks')},
|
||||||
|
color: 'yellow'),
|
||||||
const Gap(40),
|
const Gap(40),
|
||||||
// TextButton(onPressed: () => {_signOut()}, child: const Text('Logout')),
|
|
||||||
ButtonWidget(
|
ButtonWidget(
|
||||||
text: 'Logout',
|
text: 'Logout',
|
||||||
onPressed: signOut,
|
onPressed: signOut,
|
||||||
|
|
|
||||||
|
|
@ -75,11 +75,11 @@ class _RegisterPageState extends State<RegisterPage> {
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: EdgeInsets.fromLTRB(32, 32, 32, 40),
|
padding: EdgeInsets.fromLTRB(32, 32, 32, 40),
|
||||||
decoration: BoxDecoration(
|
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)),
|
borderRadius: BorderRadius.all(Radius.circular(16)),
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
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,
|
spreadRadius: 0,
|
||||||
blurRadius: 4,
|
blurRadius: 4,
|
||||||
offset: Offset(0, 2),
|
offset: Offset(0, 2),
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,20 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:gap/gap.dart';
|
import 'package:gap/gap.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
// import 'package:pharmacy_mobile/widgets/text_widget.dart';
|
|
||||||
|
|
||||||
class MenuWidget extends StatelessWidget {
|
class MenuWidget extends StatelessWidget {
|
||||||
final String text;
|
final String text;
|
||||||
final IconData? icon;
|
final IconData? icon;
|
||||||
final VoidCallback? onPressed;
|
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
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|
@ -20,7 +25,10 @@ class MenuWidget extends StatelessWidget {
|
||||||
padding: EdgeInsets.only(top: 16, bottom: 16),
|
padding: EdgeInsets.only(top: 16, bottom: 16),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(12),
|
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(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
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,
|
alignment: Alignment.center,
|
||||||
height: MediaQuery.of(context).size.height,
|
height: MediaQuery.of(context).size.height,
|
||||||
decoration: const BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
|
image: DecorationImage(image: AssetImage('assets/background.webp'), fit: BoxFit.cover, opacity: 0.1),
|
||||||
gradient: RadialGradient(
|
gradient: RadialGradient(
|
||||||
tileMode: TileMode.clamp,
|
tileMode: TileMode.clamp,
|
||||||
colors: [
|
colors: [
|
||||||
|
|
|
||||||
|
|
@ -32,3 +32,4 @@ flutter:
|
||||||
|
|
||||||
assets:
|
assets:
|
||||||
- assets/ph_logo.webp
|
- assets/ph_logo.webp
|
||||||
|
- assets/background.webp
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue