bottom nav fixed
This commit is contained in:
@@ -27,7 +27,9 @@ class MainScreen extends StatelessWidget {
|
||||
const MainScreen({super.key});
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final PageController pageController = PageController();
|
||||
context.read<BottomNavigationBloc>().add(TabChanged(1));
|
||||
final PageController pageController = PageController(initialPage: 1);
|
||||
|
||||
return BlocBuilder<BottomNavigationBloc, BottomNavigationState>(
|
||||
builder: (context, state) {
|
||||
int selectedIndex = (state as TabState).selectedIndex;
|
||||
@@ -40,7 +42,7 @@ class MainScreen extends StatelessWidget {
|
||||
backgroundColor: Colors.white,
|
||||
body: PageView(
|
||||
controller: pageController,
|
||||
physics: const NeverScrollableScrollPhysics(), // Disable swipe
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
onPageChanged: (index) {
|
||||
context.read<BottomNavigationBloc>().add(TabChanged(index));
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user