import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; 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/text_widget.dart'; import 'package:pharmacy_mobile/widgets/title_widget.dart'; class MainPage extends StatelessWidget { const MainPage({super.key}); @override Widget build(BuildContext context) { final authService = AuthService(); void signOut() async { await authService.signOut(); context.push('/'); } void gotoAddMedicine() { context.push('/addmedicines'); } void gotoAddGenerics() { context.push('/addgenerics'); } return Scaffold( body: Container( alignment: Alignment.center, height: MediaQuery.of(context).size.height, decoration: const BoxDecoration( gradient: LinearGradient( colors: [ Color.fromRGBO(34, 51, 69, 1), Color.fromRGBO(22, 32, 44, 1), ], begin: Alignment.topCenter, end: Alignment.bottomCenter, ), ), child: Center( child: Column( children: [ const Gap(120), const TitleWidget(firstTextSize: 16, secondTextSize: 32), const Gap(32), const TextWidget(text: 'Menu'), const Gap(16), MenuWidget( icon: FontAwesomeIcons.squarePlus, text: 'Add Medicine', onPressed: gotoAddMedicine, ), const Gap(16), MenuWidget( icon: FontAwesomeIcons.squarePlus, text: 'Add Generics', onPressed: gotoAddGenerics, ), const Gap(16), MenuWidget( icon: FontAwesomeIcons.squarePlus, text: 'Add Stock', ), const Gap(16), MenuWidget( icon: FontAwesomeIcons.squarePlus, text: 'Add Medicine Type', onPressed: () => {context.push('/addtype')}), const Gap(32), MenuWidget( icon: FontAwesomeIcons.listCheck, text: 'List of Stocks', ), const Gap(32), // TextButton(onPressed: () => {_signOut()}, child: const Text('Logout')), ButtonWidget( text: 'Logout', onPressed: signOut, ) ], ), ), ), ); } }