import 'package:flutter/material.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/blocs/guest/functions/bloc_getgueststatus.dart'; import 'package:pharmacy_mobile/widgets/button_widget.dart'; import 'package:pharmacy_mobile/widgets/customer_pagebackground_widget.dart'; import 'package:pharmacy_mobile/widgets/customer_title_widget.dart'; import 'package:pharmacy_mobile/widgets/snackbar_widget.dart'; import 'package:pharmacy_mobile/widgets/text_widget.dart'; // import 'package:flutter_settings_screens/flutter_settings_screens.dart'; class CustomerProfilePage extends StatefulWidget { const CustomerProfilePage({super.key}); @override State createState() => _CustomerProfilePageState(); } class _CustomerProfilePageState extends State { final _authService = AuthService(); late bool _isGuest = false; void _signOut() async { // ignore: use_build_context_synchronously await _authService.signOut().then((_) => {context.go('/'), showNotification(context, 'Logged Out', true)}); } void checkGuest() async { final guest = await blocGetGuestStatus(context); setState(() { _isGuest = guest; }); } @override void initState() { checkGuest(); super.initState(); } @override Widget build(BuildContext context) { return Scaffold( body: CustomerPagebackgroundWidget( child: Column( children: [ Column( children: [ const Gap(68), const CustomerTitleWidget(), const Gap(32), _isGuest ? const TextWidget(text: 'Guest Profile') : const TextWidget(text: 'My Profile'), const Gap(16), Row( mainAxisAlignment: MainAxisAlignment.start, children: [ const TextWidget( text: 'Name:', size: 12, ), const Gap(8), const TextWidget( text: 'Guest', size: 12, ), ], ), const Gap(16), Row( mainAxisAlignment: MainAxisAlignment.start, children: [ const TextWidget( text: 'Name:', size: 12, ), const Gap(8), const TextWidget( text: 'Guest', size: 12, ), ], ), // SimpleSettingsTile( // title: 'Advanced', // subtitle: 'More, advanced settings.', // // screen: SettingsScreen( // // title: 'Sub menu', // // children: [ // // CheckboxSettingsTile( // // settingsKey: 'key-of-your-setting', // // title: 'This is a simple Checkbox', // // ), // // ], // // ), // ), const Gap(32), ButtonWidget(text: 'Log Out', onPressed: _signOut) ], ) ], ))); } }