import 'package:flutter/material.dart'; import 'package:hmg_patient_app_new/core/app_state.dart'; import 'package:hmg_patient_app_new/core/dependencies.dart'; import 'package:hmg_patient_app_new/presentation/book_appointment/book_appointment_page.dart'; import 'package:hmg_patient_app_new/presentation/hmg_services/services_page.dart'; import 'package:hmg_patient_app_new/presentation/home/landing_page.dart'; import 'package:hmg_patient_app_new/presentation/medical_file/medical_file_page.dart'; import 'package:hmg_patient_app_new/widgets/bottom_navigation/bottom_navigation.dart'; class LandingNavigation extends StatefulWidget { const LandingNavigation({super.key}); @override State createState() => _LandingNavigationState(); } class _LandingNavigationState extends State { int _currentIndex = 0; late AppState appState; final PageController _pageController = PageController(); @override Widget build(BuildContext context) { appState = getIt.get(); return Scaffold( body: PageView( controller: _pageController, physics: const NeverScrollableScrollPhysics(), children: [ const LandingPage(), appState.isAuthenticated ? MedicalFilePage() : /* need add feedback page */ const LandingPage(), BookAppointmentPage(), const LandingPage(), appState.isAuthenticated ? /* need add news page */ ServicesPage() : const LandingPage(), ], ), bottomNavigationBar: BottomNavigation( context: context, currentIndex: _currentIndex, onTap: (index) { setState(() => _currentIndex = index); _pageController.animateToPage(index, duration: const Duration(milliseconds: 300), curve: Curves.easeInOut); }, ), ); } }