You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.3 KiB
Dart
44 lines
1.3 KiB
Dart
|
2 months ago
|
import 'package:flutter/material.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<LandingNavigation> createState() => _LandingNavigationState();
|
||
|
|
}
|
||
|
|
|
||
|
|
class _LandingNavigationState extends State<LandingNavigation> {
|
||
|
|
int _currentIndex = 0;
|
||
|
|
final PageController _pageController = PageController();
|
||
|
|
|
||
|
|
@override
|
||
|
|
Widget build(BuildContext context) {
|
||
|
|
return Scaffold(
|
||
|
|
body: PageView(
|
||
|
|
controller: _pageController,
|
||
|
|
physics: const NeverScrollableScrollPhysics(),
|
||
|
|
children: const [
|
||
|
|
LandingPage(),
|
||
|
|
MedicalFilePage(),
|
||
|
|
LandingPage(),
|
||
|
|
LandingPage(),
|
||
|
|
LandingPage(),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
bottomNavigationBar: BottomNavigation(
|
||
|
|
currentIndex: _currentIndex,
|
||
|
|
onTap: (index) {
|
||
|
|
setState(() => _currentIndex = index);
|
||
|
|
_pageController.animateToPage(
|
||
|
|
index,
|
||
|
|
duration: const Duration(milliseconds: 300),
|
||
|
|
curve: Curves.easeInOut);
|
||
|
|
},
|
||
|
|
),
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|