flutter - Flutter - 如何在底部导航栏中制作圆形按钮
问题描述
我想在导航栏中间制作一个类似于 youtube 的圆形按钮。
这是我的代码
BottomNavigationBarItem(
icon: Icon(
Icons.home,
color: Colors.grey,
),
label: 'Home',
activeIcon: Icon(
Icons.home,
color: Colors.green,
),
),
BottomNavigationBarItem(
icon: Icon(
Icons.search,
color: Colors.grey,
),
label: 'Search',
activeIcon: Icon(
Icons.search,
color: Colors.green,
),
),
BottomNavigationBarItem(
icon: OutlinedButton(
onPressed: () {
print('xxx');
},
child: Icon(
Icons.add,
color: Colors.grey,
),
style: OutlinedButton.styleFrom(
primary: Colors.grey,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
),
),
label: '',
),
BottomNavigationBarItem(
icon: Icon(
Icons.shopping_cart,
color: Colors.grey,
),
activeIcon: Icon(
Icons.shopping_cart,
color: Colors.green,
),
label: 'Groceries',
),
BottomNavigationBarItem(
icon: Icon(
Icons.person,
color: Colors.grey,
),
activeIcon: Icon(
Icons.person,
color: Colors.green,
),
label: 'Account',
),
这就是我想要的最终结果。
解决方案
Icon(
Icons.add_circle_outline,
color: Colors.white,
size: 30,
),
您可以使用颤振内置图标。
推荐阅读
- jpa - 在 JPA 中指定一对一关系外键
- spring-cloud-stream - 在 SCDF 启动/重启时重新部署 Streams
- python - 如何在 tkinter 中配置标签
- autodesk-forge - 受 3ds Max 中缩放影响的 Ambien 阴影
- javascript - Cookie 不会与外部网站保持一致
- python - PyPDF2 添加元数据
- java - 添加 Spring Security 时出错
- google-cloud-storage - 如何在 Dataflow 中使用光束 TextIO 读取云存储中的大文件
- c - 打印值、指针和指向值的指针
- ios - 使用类似“标签”的单元格设置 collectionView