【发布时间】:2020-12-11 17:31:05
【问题描述】:
我想从底部导航中删除这种白色。我该怎么做?
这是我的底部导航条码:
class MyNavigation extends StatefulWidget {
@override
_MyNavigationState createState() => _MyNavigationState();
}
class _MyNavigationState extends State<MyNavigation> {
int _currentIndex = 0;
List<Widget> children = <Widget>[
MyHomePage(),
MyWallet(),
MyNotification(),
MyProfile(),
];
@override
Widget build(BuildContext context) {
return Scaffold(
body: children.elementAt(_currentIndex),
bottomNavigationBar: CustomBottomNavigationBar(
items: [
CustomBottomNavigationBarItem(
icon: Icons.home_filled,
title: "Home",
),
CustomBottomNavigationBarItem(
icon: Icons.home_filled,
title: "Directions",
),
CustomBottomNavigationBarItem(
icon: Icons.settings,
title: "Settings",
),
],
onTap: (index) {
setState(
() {
_currentIndex = index;
},
);
},
),
);
}
}
我使用的这个依赖: https://pub.dev/packages/custom_bottom_navigation_bar
【问题讨论】:
-
你试过 backgroundColor: Colors.transparent 吗?
-
当所选项目看起来与 FAB 完全一样时,用户体验非常糟糕......
标签: flutter bottomnavigationview