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
+4 -54
View File
@@ -50,9 +50,6 @@ class _MedicalCertificatesPageState extends State<MedicalCertificatesPage> {
DateTime? expiryDate;
bool uploading = false;
// ✅ questa pagina è "sezione account"
int bottomIndex = 2;
@override
void initState() {
super.initState();
@@ -286,54 +283,6 @@ class _MedicalCertificatesPageState extends State<MedicalCertificatesPage> {
bool _isPdfPath(String p) => p.toLowerCase().endsWith('.pdf');
Future<void> _goTo(Widget page) async {
if (!mounted) return;
Navigator.pushReplacement(context, MaterialPageRoute(builder: (_) => page));
}
void _handleBottomNav(int i) {
if (i == bottomIndex) return;
setState(() => bottomIndex = i);
if (i == 0) {
_goTo(
HomePage(
token: widget.token,
school: widget.school,
userFirstName: widget.userFirstName,
),
);
return;
}
if (i == 1) {
_goTo(
LessonsPage(
token: widget.token,
school: widget.school,
userFirstName: widget.userFirstName,
),
);
return;
}
if (i == 2) {
// siamo già in "area account", non facciamo nulla (o TODO)
return;
}
if (i == 3) {
_goTo(
MeditationPage(
token: widget.token,
school: widget.school,
userFirstName: widget.userFirstName,
),
);
return;
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
@@ -359,10 +308,11 @@ class _MedicalCertificatesPageState extends State<MedicalCertificatesPage> {
],
),
// ✅ Bottom nav standard (come MeditationPage)
bottomNavigationBar: AppBottomNav(
currentIndex: bottomIndex,
onTap: _handleBottomNav,
currentIndex: 2,
token: widget.token,
school: widget.school,
userFirstName: widget.userFirstName,
),
body: YogibookBackground(