update
This commit is contained in:
parent
5537edb6c5
commit
5f38ce753f
14 changed files with 322 additions and 191 deletions
|
|
@ -1,19 +1,10 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
// import 'package:gap/gap.dart';
|
||||
// import 'package:pharmacy_mobile/auth/auth_service.dart';
|
||||
import 'package:pharmacy_mobile/pages/customer_pages/customer_additem_page.dart';
|
||||
import 'package:pharmacy_mobile/pages/customer_pages/customer_cart_page.dart';
|
||||
import 'package:pharmacy_mobile/pages/customer_pages/customer_main_page.dart';
|
||||
import 'package:pharmacy_mobile/pages/customer_pages/customer_profile_page.dart';
|
||||
import 'package:pharmacy_mobile/pages/customer_pages/customer_search_page.dart';
|
||||
// import 'package:pharmacy_mobile/widgets/button_widget.dart';
|
||||
// import 'package:pharmacy_mobile/widgets/logo_widget.dart';
|
||||
// import 'package:pharmacy_mobile/widgets/menu_widget.dart';
|
||||
// import 'package:pharmacy_mobile/widgets/page_background_widget.dart';
|
||||
// import 'package:pharmacy_mobile/widgets/snackbar_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/text_widget.dart';
|
||||
// import 'package:pharmacy_mobile/widgets/title_widget.dart';
|
||||
import 'package:animated_notch_bottom_bar/animated_notch_bottom_bar/animated_notch_bottom_bar.dart';
|
||||
|
||||
class CustomerPage extends StatefulWidget {
|
||||
|
|
@ -36,13 +27,15 @@ class _CustomerPageState extends State<CustomerPage> {
|
|||
controller: _notchController,
|
||||
),
|
||||
const CustomerSearchPage(),
|
||||
const CustomerAddItemPage(),
|
||||
const CustomerCartPage(),
|
||||
const CustomerProfilePage()
|
||||
];
|
||||
|
||||
final Color selectedBarColor = const Color.fromRGBO(241, 255, 255, 0.83);
|
||||
final Color unselectedBarColor = const Color.fromRGBO(206, 206, 206, 1);
|
||||
final double barFontSize = 12;
|
||||
final double barIconInactiveSize = 20;
|
||||
final double barIconActiveSize = 20;
|
||||
|
||||
return PopScope(
|
||||
canPop: false,
|
||||
|
|
@ -59,50 +52,67 @@ class _CustomerPageState extends State<CustomerPage> {
|
|||
showLabel: true,
|
||||
textOverflow: TextOverflow.visible,
|
||||
maxLine: 1,
|
||||
// shadowElevation: 5,
|
||||
kBottomRadius: 28.0,
|
||||
color: const Color.fromARGB(99, 204, 166, 240),
|
||||
notchColor: const Color.fromARGB(161, 209, 166, 240),
|
||||
kIconSize: 24,
|
||||
kBottomRadius: 20.0,
|
||||
color: const Color.fromRGBO(90, 73, 106, 1),
|
||||
notchColor: const Color.fromRGBO(182, 143, 210, 1),
|
||||
removeMargins: false,
|
||||
bottomBarWidth: 500,
|
||||
durationInMilliSeconds: 300,
|
||||
// itemLabelStyle: const TextStyle(fontSize: 10),
|
||||
// elevation: 1,
|
||||
bottomBarItems: [
|
||||
BottomBarItem(
|
||||
inActiveItem: FaIcon(FontAwesomeIcons.house, size: 20, color: unselectedBarColor),
|
||||
inActiveItem: FaIcon(FontAwesomeIcons.house, size: barIconInactiveSize, color: unselectedBarColor),
|
||||
activeItem: FaIcon(
|
||||
FontAwesomeIcons.house,
|
||||
size: 20,
|
||||
size: barIconActiveSize,
|
||||
color: selectedBarColor,
|
||||
),
|
||||
itemLabelWidget: TextWidget(text: 'Home', size: 12, bold: true, color: unselectedBarColor)),
|
||||
itemLabelWidget: TextWidget(
|
||||
text: 'Home',
|
||||
size: barFontSize,
|
||||
bold: true,
|
||||
color: unselectedBarColor,
|
||||
footer: true,
|
||||
)),
|
||||
BottomBarItem(
|
||||
inActiveItem: FaIcon(FontAwesomeIcons.magnifyingGlass, size: 20, color: unselectedBarColor),
|
||||
activeItem: Icon(FontAwesomeIcons.magnifyingGlass, size: 20, color: selectedBarColor),
|
||||
itemLabelWidget: TextWidget(text: 'Search', size: 12, bold: true, color: unselectedBarColor),
|
||||
inActiveItem:
|
||||
FaIcon(FontAwesomeIcons.magnifyingGlass, size: barIconInactiveSize, color: unselectedBarColor),
|
||||
activeItem: Icon(FontAwesomeIcons.magnifyingGlass, size: barIconActiveSize, color: selectedBarColor),
|
||||
itemLabelWidget: TextWidget(
|
||||
text: 'Search',
|
||||
size: barFontSize,
|
||||
bold: true,
|
||||
color: unselectedBarColor,
|
||||
footer: true,
|
||||
),
|
||||
),
|
||||
BottomBarItem(
|
||||
inActiveItem: FaIcon(FontAwesomeIcons.plus, size: 20, color: unselectedBarColor),
|
||||
activeItem: Icon(FontAwesomeIcons.plus, size: 20, color: selectedBarColor),
|
||||
itemLabelWidget: TextWidget(text: 'Add Item', size: 12, bold: true, color: unselectedBarColor),
|
||||
inActiveItem:
|
||||
FaIcon(FontAwesomeIcons.cartShopping, size: barIconInactiveSize, color: unselectedBarColor),
|
||||
activeItem: FaIcon(FontAwesomeIcons.cartShopping, size: barIconActiveSize, color: selectedBarColor),
|
||||
itemLabelWidget: TextWidget(
|
||||
text: 'Cart',
|
||||
size: barFontSize,
|
||||
bold: true,
|
||||
color: unselectedBarColor,
|
||||
footer: true,
|
||||
),
|
||||
),
|
||||
BottomBarItem(
|
||||
inActiveItem: FaIcon(FontAwesomeIcons.cartShopping, size: 20, color: unselectedBarColor),
|
||||
activeItem: FaIcon(FontAwesomeIcons.cartShopping, size: 20, color: selectedBarColor),
|
||||
itemLabelWidget: TextWidget(text: 'Cart', size: 12, bold: true, color: unselectedBarColor),
|
||||
),
|
||||
BottomBarItem(
|
||||
inActiveItem: Icon(Icons.person, size: 20, color: unselectedBarColor),
|
||||
activeItem: Icon(Icons.person, size: 20, color: selectedBarColor),
|
||||
itemLabelWidget: TextWidget(text: 'Profile', size: 12, bold: true, color: unselectedBarColor),
|
||||
inActiveItem: Icon(Icons.person, size: barIconInactiveSize, color: unselectedBarColor),
|
||||
activeItem: Icon(Icons.person, size: barIconActiveSize, color: selectedBarColor),
|
||||
itemLabelWidget: TextWidget(
|
||||
text: 'Profile',
|
||||
size: barFontSize,
|
||||
bold: true,
|
||||
color: unselectedBarColor,
|
||||
footer: true,
|
||||
),
|
||||
),
|
||||
],
|
||||
onTap: (index) {
|
||||
_pageController.jumpToPage(index);
|
||||
setState(() {});
|
||||
},
|
||||
kIconSize: 24,
|
||||
)));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,30 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:pharmacy_mobile/widgets/page_background_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/text_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/title_widget.dart';
|
||||
import 'package:animated_notch_bottom_bar/animated_notch_bottom_bar/animated_notch_bottom_bar.dart';
|
||||
|
||||
class CustomerAddItemPage extends StatelessWidget {
|
||||
final NotchBottomBarController? controller;
|
||||
const CustomerAddItemPage({super.key, this.controller});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: PageBackgroundWidget(
|
||||
child: Column(
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
const Gap(96),
|
||||
const TitleWidget(firstTextSize: 20, secondTextSize: 32),
|
||||
const Gap(32),
|
||||
const TextWidget(text: 'Add Item'),
|
||||
const Gap(16),
|
||||
],
|
||||
)
|
||||
],
|
||||
)));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,9 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:pharmacy_mobile/auth/auth_service.dart';
|
||||
import 'package:pharmacy_mobile/widgets/button_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/menu_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/page_background_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/snackbar_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/text_widget.dart';
|
||||
|
|
@ -38,6 +40,12 @@ class _CustomerMainPageState extends State<CustomerMainPage> {
|
|||
const Gap(32),
|
||||
const TextWidget(text: 'Menu'),
|
||||
const Gap(16),
|
||||
MenuWidget(
|
||||
icon: FontAwesomeIcons.eraser,
|
||||
text: 'Remove Stock',
|
||||
onPressed: () => {context.push('/deletestock')},
|
||||
),
|
||||
const Gap(32),
|
||||
ButtonWidget(text: 'Log Out', onPressed: signOut)
|
||||
],
|
||||
)
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import 'package:gap/gap.dart';
|
|||
import 'package:go_router/go_router.dart';
|
||||
import 'package:pharmacy_mobile/auth/auth_service.dart';
|
||||
import 'package:pharmacy_mobile/widgets/button_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/menu_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/menu_widget2.dart';
|
||||
import 'package:pharmacy_mobile/widgets/page_background_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/snackbar_widget.dart';
|
||||
import 'package:pharmacy_mobile/widgets/text_widget.dart';
|
||||
|
|
@ -43,45 +43,54 @@ class _MainPageState extends State<MainPage> {
|
|||
const Gap(32),
|
||||
const TextWidget(text: 'Menu'),
|
||||
const Gap(16),
|
||||
MenuWidget(
|
||||
icon: FontAwesomeIcons.squarePlus,
|
||||
text: 'Add Type',
|
||||
onPressed: () => {context.push('/addtype')},
|
||||
color: 'blue'),
|
||||
MenuWidget2(
|
||||
icon: FontAwesomeIcons.circlePlus,
|
||||
text: 'Add Type',
|
||||
description: 'Create a new medical type',
|
||||
onPressed: () => {context.push('/addtype')},
|
||||
color: 'blue',
|
||||
),
|
||||
const Gap(16),
|
||||
MenuWidget(
|
||||
icon: FontAwesomeIcons.squarePlus,
|
||||
text: 'Add Category',
|
||||
onPressed: () => {context.push('/addcategory')},
|
||||
color: 'blue'),
|
||||
MenuWidget2(
|
||||
icon: FontAwesomeIcons.circlePlus,
|
||||
text: 'Add Category',
|
||||
description: 'Create a new medicine category',
|
||||
onPressed: () => {context.push('/addtype')},
|
||||
color: 'blue',
|
||||
),
|
||||
const Gap(16),
|
||||
MenuWidget(
|
||||
icon: FontAwesomeIcons.squarePlus,
|
||||
MenuWidget2(
|
||||
icon: FontAwesomeIcons.circlePlus,
|
||||
text: 'Add Generics',
|
||||
description: 'Add generic name on the list',
|
||||
onPressed: () => {context.push('/addgenerics')},
|
||||
color: 'blue'),
|
||||
const Gap(32),
|
||||
MenuWidget(
|
||||
icon: FontAwesomeIcons.squarePlus,
|
||||
MenuWidget2(
|
||||
icon: FontAwesomeIcons.circlePlus,
|
||||
text: 'Add Medicine',
|
||||
description: 'Add generic name on the list',
|
||||
onPressed: () => {context.push('/addmedicines')},
|
||||
color: 'green'),
|
||||
const Gap(16),
|
||||
MenuWidget(
|
||||
icon: FontAwesomeIcons.squarePlus,
|
||||
MenuWidget2(
|
||||
icon: FontAwesomeIcons.circlePlus,
|
||||
text: 'Add Stock',
|
||||
description: 'Add generic name on the list',
|
||||
onPressed: () => {context.push('/addstock')},
|
||||
color: 'green'),
|
||||
const Gap(32),
|
||||
MenuWidget(
|
||||
icon: FontAwesomeIcons.eraser,
|
||||
MenuWidget2(
|
||||
icon: Icons.delete,
|
||||
text: 'Remove Stock',
|
||||
description: 'Add generic name on the list',
|
||||
onPressed: () => {context.push('/deletestock')},
|
||||
color: 'red'),
|
||||
const Gap(32),
|
||||
MenuWidget(
|
||||
MenuWidget2(
|
||||
icon: FontAwesomeIcons.listCheck,
|
||||
text: 'List of Stocks',
|
||||
description: 'Add generic name on the list',
|
||||
onPressed: () => {context.push('/liststocks')},
|
||||
color: 'yellow'),
|
||||
const Gap(40),
|
||||
|
|
|
|||
99
lib/widgets/menu_widget2.dart
Normal file
99
lib/widgets/menu_widget2.dart
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:pharmacy_mobile/widgets/text_widget.dart';
|
||||
|
||||
class MenuWidget2 extends StatelessWidget {
|
||||
final String text;
|
||||
final IconData? icon;
|
||||
final VoidCallback? onPressed;
|
||||
final String? color;
|
||||
final String description;
|
||||
|
||||
final List<Color> blue = [
|
||||
const Color.fromRGBO(59, 101, 156, 1),
|
||||
const Color.fromRGBO(59, 101, 156, 1),
|
||||
const Color.fromRGBO(59, 156, 156, 1),
|
||||
];
|
||||
|
||||
final List<Color> green = [
|
||||
const Color.fromRGBO(59, 156, 103, 1),
|
||||
const Color.fromRGBO(59, 156, 103, 1),
|
||||
const Color.fromRGBO(122, 182, 70, 1),
|
||||
];
|
||||
|
||||
final List<Color> red = [
|
||||
const Color.fromRGBO(156, 59, 59, 1),
|
||||
const Color.fromRGBO(164, 62, 62, 1),
|
||||
const Color.fromRGBO(186, 120, 70, 1),
|
||||
];
|
||||
|
||||
final List<Color> yellow = [
|
||||
const Color.fromRGBO(156, 156, 59, 1),
|
||||
const Color.fromRGBO(156, 156, 59, 1),
|
||||
const Color.fromRGBO(104, 156, 59, 1),
|
||||
];
|
||||
|
||||
MenuWidget2({super.key, required this.text, required this.description, this.icon, this.onPressed, this.color});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: onPressed,
|
||||
child: Container(
|
||||
width: MediaQuery.of(context).size.width - 96,
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
gradient: LinearGradient(
|
||||
colors: _getColorList(color!),
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
const Gap(24),
|
||||
// Icon(icon, size: 28, color: Colors.white),
|
||||
FaIcon(icon, size: 28, color: Colors.white),
|
||||
const Gap(32),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
TextWidget(
|
||||
text: text,
|
||||
size: 20,
|
||||
),
|
||||
const Gap(4),
|
||||
TextWidget(
|
||||
text: description,
|
||||
size: 12,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
List<Color> _getColorList(String color) {
|
||||
switch (color.toLowerCase()) {
|
||||
case 'green':
|
||||
return green;
|
||||
case 'blue':
|
||||
return blue;
|
||||
case 'red':
|
||||
return red;
|
||||
case 'yellow':
|
||||
return yellow;
|
||||
default:
|
||||
return [
|
||||
const Color.fromRGBO(0, 0, 0, 1),
|
||||
const Color.fromRGBO(68, 68, 68, 1),
|
||||
const Color.fromRGBO(158, 158, 158, 1),
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue