App*_*247 6 font-awesome flutter
我在 Flutter 中有一个底部导航栏,并计划为这些项目使用 Font Awesome Icons。但是,与材质图标相比,字体真棒图标周围没有任何间距。这使他们触摸底部导航栏项目标题。有什么办法可以在这些之间添加空格吗?
底部导航条码:
BottomNavigationBar(
type: BottomNavigationBarType.shifting,
currentIndex: _currentIndex,
items: [
BottomNavigationBarItem(
icon: Icon(
Icons.list,
size: 30.0,
),
title: Text('Notice Board'),
backgroundColor: Colors.grey[900],
),
BottomNavigationBarItem(
icon: Icon(
FontAwesomeIcons.handsHelping,
// size: 30.0,
),
title: Text('Services'),
backgroundColor: Colors.green,
),
BottomNavigationBarItem(
icon: Icon(
Icons.add,
size: 35.0,
),
title: Text('Create'),
backgroundColor: Colors.cyan,
),
BottomNavigationBarItem(
icon: Icon(
FontAwesomeIcons.store,
// size: 30.0,
),
title: Text('Marketplace'),
backgroundColor: Colors.orange,
),
],
onTap: (index) {
setState(() {
_currentIndex = index;
});
},
),
Run Code Online (Sandbox Code Playgroud)
您可以尝试在使用 Font Awesome 的图标周围添加一个 Padding 小部件(https://api.flutter.dev/flutter/widgets/Padding-class.html )。
我对@Ludovic Garon 回答的使用
icon: Padding(
padding: EdgeInsets.all(16.0),
child: Icon(Icons.search),
),
归档时间: |
|
查看次数: |
4463 次 |
最近记录: |