fixed bugs
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user