update on settings and customer background
This commit is contained in:
parent
05c3208cad
commit
6424e82d54
18 changed files with 227 additions and 42 deletions
|
|
@ -152,17 +152,16 @@ class _CustomerCartPageState extends State<CustomerCartPage> {
|
|||
const Gap(16),
|
||||
const TextWidget(
|
||||
text: 'Cart is disabled for guests',
|
||||
size: 16,
|
||||
size: 12,
|
||||
),
|
||||
const Gap(8),
|
||||
const Gap(32),
|
||||
const TextWidget(
|
||||
text: 'Please login',
|
||||
size: 32,
|
||||
size: 20,
|
||||
),
|
||||
const Gap(8),
|
||||
const TextWidget(
|
||||
text: 'to use your cart',
|
||||
size: 24,
|
||||
size: 16,
|
||||
),
|
||||
const Gap(32),
|
||||
Padding(
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ class _CustomerMainPageState extends State<CustomerMainPage> {
|
|||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: CustomerPagebackgroundWidget(
|
||||
height: MediaQuery.of(context).size.height * 1.4,
|
||||
child: Column(
|
||||
children: [
|
||||
const Gap(68),
|
||||
|
|
|
|||
|
|
@ -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