update on settings and customer background
This commit is contained in:
parent
05c3208cad
commit
6424e82d54
18 changed files with 227 additions and 42 deletions
|
|
@ -3,6 +3,7 @@ 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/functions/getlanguage_function.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';
|
||||
|
|
@ -22,6 +23,7 @@ class _CustomerSettingsPageState extends State<CustomerSettingsPage> {
|
|||
|
||||
late String currentName = '';
|
||||
late bool _isGuest = false;
|
||||
late String currentLanguage = '';
|
||||
|
||||
void _signOut() async {
|
||||
// ignore: use_build_context_synchronously
|
||||
|
|
@ -38,6 +40,13 @@ class _CustomerSettingsPageState extends State<CustomerSettingsPage> {
|
|||
return username ?? '';
|
||||
}
|
||||
|
||||
void gotoSettings() async {
|
||||
final changed = await context.push<bool>('/languagesetting');
|
||||
if (changed == true) {
|
||||
setState(() {});
|
||||
}
|
||||
}
|
||||
|
||||
void autoRun() async {
|
||||
final guest = await _checkGuest();
|
||||
if (guest) {
|
||||
|
|
@ -45,7 +54,8 @@ class _CustomerSettingsPageState extends State<CustomerSettingsPage> {
|
|||
} else {
|
||||
currentName = await _getUsername();
|
||||
}
|
||||
|
||||
// ignore: use_build_context_synchronously
|
||||
currentLanguage = await getLanguage(context);
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
|
|
@ -69,10 +79,7 @@ class _CustomerSettingsPageState extends State<CustomerSettingsPage> {
|
|||
const TextWidget(text: 'Settings'),
|
||||
const Gap(16),
|
||||
SettingWidget(
|
||||
icon: Icons.language,
|
||||
title: 'Language',
|
||||
value: 'English',
|
||||
onPressed: () => context.push('/languagesetting')),
|
||||
icon: Icons.language, title: 'Language', value: currentLanguage, onPressed: () => gotoSettings()),
|
||||
const Gap(8),
|
||||
SettingWidget(
|
||||
icon: Icons.person,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue