fixed bugs

This commit is contained in:
2026-08-21 13:11:55 +02:00
parent ab36215b7a
commit 64eade33f3
16 changed files with 367 additions and 361 deletions
+19 -46
View File
@@ -35,8 +35,6 @@ class _HomePageState extends State<HomePage> {
static const Color kBg = Color(0xFFF6F6FB);
static const Color kGreen = Color(0xFF10B981);
int bottomIndex = 0; // Home
late final String zenQuote;
@override
@@ -224,44 +222,6 @@ class _HomePageState extends State<HomePage> {
);
}
void _handleBottomNav(int i) {
setState(() => bottomIndex = i);
if (i == 0) return;
if (i == 1) {
_goLessons();
return;
}
if (i == 2) {
Navigator.push(
context,
MaterialPageRoute(
builder: (_) => AccountPage(
token: widget.token,
school: widget.school,
userFirstName: widget.userFirstName,
),
),
).then((_) {
if (mounted) setState(() => bottomIndex = 0);
});
return;
}
if (i == 3) {
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (_) => MeditationPage(
token: widget.token,
school: widget.school,
userFirstName: widget.userFirstName,
),
),
);
return;
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
@@ -299,8 +259,10 @@ class _HomePageState extends State<HomePage> {
),
bottomNavigationBar: AppBottomNav(
currentIndex: bottomIndex,
onTap: _handleBottomNav,
currentIndex: 0,
token: widget.token,
school: widget.school,
userFirstName: widget.userFirstName,
),
body: YogibookBackground(
@@ -378,16 +340,27 @@ class _HomePageState extends State<HomePage> {
onTap: () => Navigator.push(
context,
MaterialPageRoute(
builder: (_) => OrdersDetailPage(token: widget.token),
builder: (_) => OrdersDetailPage(
token: widget.token,
school: widget.school,
userFirstName: widget.userFirstName,
),
),
),
),
_HomeTile(
icon: Icons.person_rounded,
title: 'Account',
subtitle: 'Profilo e impostazioni (TODO)',
onTap: () => ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('TODO: Account')),
subtitle: 'Profilo e impostazioni',
onTap: () => Navigator.push(
context,
MaterialPageRoute(
builder: (_) => AccountPage(
token: widget.token,
school: widget.school,
userFirstName: widget.userFirstName,
),
),
),
),