This commit is contained in:
Patrick Alvin Alcala 2025-02-06 17:16:23 +08:00
parent 064814e165
commit 47a2d34933
2 changed files with 62 additions and 64 deletions

View file

@ -28,7 +28,7 @@ class _LoginPageState extends State<LoginPage> {
bool _isLoading = false; bool _isLoading = false;
void _signIn() async { void _signIn() async {
if (_isLoading) return; // if (_isLoading) return;
final email = _emailController.text; final email = _emailController.text;
final password = _passwordController.text; final password = _passwordController.text;

View file

@ -6,6 +6,7 @@ import 'package:pharmacy_mobile/auth/auth_service.dart';
import 'package:pharmacy_mobile/widgets/button_widget.dart'; import 'package:pharmacy_mobile/widgets/button_widget.dart';
import 'package:pharmacy_mobile/widgets/menu_widget.dart'; import 'package:pharmacy_mobile/widgets/menu_widget.dart';
import 'package:pharmacy_mobile/widgets/page_background_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/text_widget.dart';
import 'package:pharmacy_mobile/widgets/title_widget.dart'; import 'package:pharmacy_mobile/widgets/title_widget.dart';
@ -17,72 +18,69 @@ class MainPage extends StatelessWidget {
final authService = AuthService(); final authService = AuthService();
void signOut() async { void signOut() async {
await authService.signOut().then((_) => {context.push('/')}); await authService.signOut().then((_) => {context.push('/'), showNotification(context, 'Logged Out', true)});
} }
void gotoAddMedicine() { return PopScope(
context.push('/addmedicines'); canPop: false,
} child: Scaffold(
resizeToAvoidBottomInset: false,
void gotoAddGenerics() { body: SingleChildScrollView(
context.push('/addgenerics'); child: PageBackgroundWidget(
} page: 'menu',
child: Center(
return Scaffold( child: Column(
resizeToAvoidBottomInset: false, children: [
body: SingleChildScrollView( const Gap(96),
child: PageBackgroundWidget( const TitleWidget(firstTextSize: 20, secondTextSize: 32),
page: 'menu', const Gap(32),
child: Center( const TextWidget(text: 'Menu'),
child: Column( const Gap(16),
children: [ MenuWidget(
const Gap(96), icon: FontAwesomeIcons.squarePlus,
const TitleWidget(firstTextSize: 20, secondTextSize: 32), text: 'Add Type',
const Gap(32), onPressed: () => {context.push('/addtype')},
const TextWidget(text: 'Menu'), color: 'blue'),
const Gap(16), const Gap(16),
MenuWidget( MenuWidget(
icon: FontAwesomeIcons.squarePlus, icon: FontAwesomeIcons.squarePlus,
text: 'Add Type', text: 'Add Category',
onPressed: () => {context.push('/addtype')}, onPressed: () => {context.push('/addcategory')},
color: 'blue'), color: 'blue'),
const Gap(16), const Gap(16),
MenuWidget( MenuWidget(
icon: FontAwesomeIcons.squarePlus, icon: FontAwesomeIcons.squarePlus,
text: 'Add Category', text: 'Add Generics',
onPressed: () => {context.push('/addcategory')}, onPressed: () => {context.push('/addgenerics')},
color: 'blue'), color: 'blue'),
const Gap(16), const Gap(32),
MenuWidget( MenuWidget(
icon: FontAwesomeIcons.squarePlus, text: 'Add Generics', onPressed: gotoAddGenerics, color: 'blue'), icon: FontAwesomeIcons.squarePlus,
const Gap(32), text: 'Add Medicine',
MenuWidget( onPressed: () => {context.push('/addmedicines')},
icon: FontAwesomeIcons.squarePlus, color: 'green'),
text: 'Add Medicine', const Gap(16),
onPressed: gotoAddMedicine, MenuWidget(
color: 'green'), icon: FontAwesomeIcons.squarePlus,
const Gap(16), text: 'Add Stock',
MenuWidget( onPressed: () => {context.push('/addstock')},
icon: FontAwesomeIcons.squarePlus, color: 'green'),
text: 'Add Stock', const Gap(32),
onPressed: () => {context.push('/addstock')}, MenuWidget(
color: 'green'), icon: FontAwesomeIcons.listCheck,
const Gap(32), text: 'List of Stocks',
MenuWidget( onPressed: () => {context.push('/liststocks')},
icon: FontAwesomeIcons.listCheck, color: 'yellow'),
text: 'List of Stocks', const Gap(40),
onPressed: () => {context.push('/liststocks')}, ButtonWidget(
color: 'yellow'), text: 'Logout',
const Gap(40), onPressed: signOut,
ButtonWidget( )
text: 'Logout', ],
onPressed: signOut, ),
) ),
],
), ),
), ),
), ));
),
);
} }
} }