Я попытался реализовать настраиваемую нижнюю панель навигации. Я использую просмотр страниц для перехода между страницами. Теперь нижняя панель навигации не находится абсолютно над просмотром страницы, но отсекает часть просмотра страницы. Кто-нибудь может мне здесь помочь?
введите описание изображения здесь
Вот соответствующий код:
Scaffold buildHomePage() {
return Scaffold(
body: PageView(
children: <Widget>[
PopularScreen(),
DiscoverScreen(),
ActivityScreen(),
ProfileScreen()
],
controller: pageController,
onPageChanged: onPageChanged,
physics: NeverScrollableScrollPhysics(),
),
bottomNavigationBar: buildBottomNavigationBar(),
);
}
Widget buildBottomNavigationBar() {
return BottomAppBar(
child: Container(
height: 65,
margin: EdgeInsets.only(left: 30, bottom: 40, right: 30),
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Colors.black12,
blurRadius: 5,
)
],
color: Colors.white,
borderRadius: BorderRadius.circular(50),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.center,
children: items.map((item) {
var itemIndex = items.indexOf(item);
return GestureDetector(
onTap: () => onTap(itemIndex),
child: _buildNavBarItem(item, pageIndex == itemIndex),
);
}).toList(),
),
),
);
}