Flutter 颤振:如何居中倾斜的孩子
我正在尝试设置Flutter 颤振:如何居中倾斜的孩子,flutter,flutter-layout,Flutter,Flutter Layout,我正在尝试设置图标按钮的背景色 这是我的密码 ClipOval( child: Container( height: 50.0, width: 50.0, color: Colors.white, child: IconButton(
图标按钮的背景色
这是我的密码
ClipOval(
child: Container(
height: 50.0,
width: 50.0,
color: Colors.white,
child: IconButton(
color: Colors.green.withOpacity(0.8),
iconSize: 50.0,
icon: Icon(Icons.add_circle),
结果如下
如何使椭圆形容器
和图标按钮
大小相同且均居中?您不需要使用容器
的宽度
和高度
属性,因为您已经在图标按钮
中使用了图标大小
。在容器中删除i容器大小
或宽度/高度
截图:
谢谢,我也到了,但我想避免戴白戒指。我想要绿色的按钮,加上白色的
ClipOval(
child: Material(
color: Colors.green,
child: InkWell(
onTap: () {},
child: Icon(
Icons.add,
color: Colors.white,
size: 50,
),
),
),
)