diff --git a/assets/background.png b/assets/background.png new file mode 100644 index 0000000..d0736c4 Binary files /dev/null and b/assets/background.png differ diff --git a/assets/background.webp b/assets/background.webp new file mode 100644 index 0000000..feeef6b Binary files /dev/null and b/assets/background.webp differ diff --git a/lib/pages/index_page.dart b/lib/pages/index_page.dart index 9b9da2d..7e564b9 100644 --- a/lib/pages/index_page.dart +++ b/lib/pages/index_page.dart @@ -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), diff --git a/lib/pages/login_page.dart b/lib/pages/login_page.dart index 8b3f6ad..7326b75 100644 --- a/lib/pages/login_page.dart +++ b/lib/pages/login_page.dart @@ -93,12 +93,11 @@ class _LoginPageState extends State { 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), diff --git a/lib/pages/main_page.dart b/lib/pages/main_page.dart index 8fb1717..a782a2a 100644 --- a/lib/pages/main_page.dart +++ b/lib/pages/main_page.dart @@ -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, diff --git a/lib/pages/register_page.dart b/lib/pages/register_page.dart index f558ab1..e62832e 100644 --- a/lib/pages/register_page.dart +++ b/lib/pages/register_page.dart @@ -75,11 +75,11 @@ class _RegisterPageState extends State { 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), diff --git a/lib/widgets/menu_widget.dart b/lib/widgets/menu_widget.dart index 4767281..636228f 100644 --- a/lib/widgets/menu_widget.dart +++ b/lib/widgets/menu_widget.dart @@ -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 + } + } } diff --git a/lib/widgets/page_background_widget.dart b/lib/widgets/page_background_widget.dart index 227b117..5030e54 100644 --- a/lib/widgets/page_background_widget.dart +++ b/lib/widgets/page_background_widget.dart @@ -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: [ diff --git a/pubspec.yaml b/pubspec.yaml index c4d9452..d0f8281 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -32,3 +32,4 @@ flutter: assets: - assets/ph_logo.webp + - assets/background.webp