update
This commit is contained in:
parent
71a289b74c
commit
d4706f5f2e
13 changed files with 86 additions and 10 deletions
|
|
@ -1,20 +1,42 @@
|
|||
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';
|
||||
import 'package:pharmacy_mobile/widgets/title_widget.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
class CustomerPage extends StatelessWidget {
|
||||
class CustomerPage extends StatefulWidget {
|
||||
const CustomerPage({super.key});
|
||||
|
||||
@override
|
||||
State<CustomerPage> createState() => _CustomerPageState();
|
||||
}
|
||||
|
||||
class _CustomerPageState extends State<CustomerPage> {
|
||||
final _authService = AuthService();
|
||||
|
||||
void sample() {}
|
||||
|
||||
void signOut() async {
|
||||
// ignore: use_build_context_synchronously
|
||||
await _authService.signOut().then((_) => {context.go('/'), showNotification(context, 'Logged Out', true)});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return PopScope(
|
||||
canPop: false,
|
||||
child: Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
body: SingleChildScrollView(
|
||||
child: PageBackgroundWidget(
|
||||
height: MediaQuery.of(context).size.height + 400,
|
||||
page: 'menu',
|
||||
child: Center(
|
||||
child: Column(
|
||||
children: [
|
||||
|
|
@ -23,6 +45,16 @@ class CustomerPage extends StatelessWidget {
|
|||
const Gap(32),
|
||||
const TextWidget(text: 'Menu'),
|
||||
const Gap(16),
|
||||
const MenuWidget(icon: FontAwesomeIcons.kitMedical, text: 'Buy Medicine', color: 'blue'),
|
||||
const Gap(32),
|
||||
ButtonWidget(
|
||||
text: 'Logout',
|
||||
onPressed: signOut,
|
||||
)
|
||||
// CustomerMenuWidget(
|
||||
// onHomePressed: sample,
|
||||
// onProfilePressed: sample,
|
||||
// )
|
||||
],
|
||||
))),
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue