我想在容器中获得这种类型的按钮,
代替这些图标按钮
答案 0 :(得分:0)
将BottomAppBar与FloatingActionButton一起使用
此处的示例:https://medium.com/coding-with-flutter/flutter-bottomappbar-navigation-with-fab-8b962bb55013
答案 1 :(得分:0)
看看FloatingActionButton
(FAB)。例如:
FloatingActionButton(
onPressed: () {
handlePressed()
},
child: SomeIcon(),
backgroundColor: Colors.red,
);
或者,您可以执行以下操作:
GestureDetector(
child: Container(
child: DecoratedBox(
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.red,
),
child: SomeIcon(),
),
),
onTap: () => handleTap(),
);
尽管在您的情况下,我还是认为FAB更有意义,从屏幕快照中可以看出,它位于BottomAppBar
上。