【发布时间】:2021-02-18 07:15:31
【问题描述】:
我在 Flutter 应用中使用了 BottomNavigationBar。我对外观有额外的要求,这是我得到的结果。一切都很好,除了顶部和底部的填充(图中的箭头)。
这是我的代码:
BottomNavigationBar(
selectedFontSize: 0,
type: BottomNavigationBarType.fixed,
currentIndex: currIndex,
items: tabs.map((e) {
return BottomNavigationBarItem(
title: SizedBox.shrink(),
icon: _buildIcon(e),
);
}).toList(),
)
Widget _buildIcon(Data data) {
return Container(
width: double.infinity,
height:kBottomNavigationBarHeight ,
child: Material(
color: _getBackgroundColor(data.index),
child: InkWell(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Icon(Icons.email_outlined),
Text('111', style: TextStyle(fontSize: 12, color: Colors.white)),
],
),
onTap: () {
onTabSelected(data.index);
},
),
),
);
}
我怎样才能删除那些顶部和底部的填充?任何想法我都会非常感激。
【问题讨论】:
标签: flutter dart flutter-layout