64 lines
2.2 KiB
Dart
64 lines
2.2 KiB
Dart
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 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: [
|
|
const Gap(96),
|
|
const TitleWidget(firstTextSize: 20, secondTextSize: 32),
|
|
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,
|
|
// )
|
|
],
|
|
))),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|