//Center:Center 是一个小部件,它将唯一的子小部件放在其中心。Center 和 Align 非常相似。它们只有一个子部件,但 Align 允许我们自定义子部件在其中的位置。
new Center(
child: new Text("测试按钮"),
// widthFactor:如果不设置Center的宽度将尽可能大的填充,如果设置后Center的宽度即为子部件的宽度乘以widthFactor的设置值
widthFactor: 10.5,
// heightFactor:如果不设置Center的高度将尽可能大的填充,如果设置后Center的高度即为子部件的宽度乘以heightFactor的设置值
heightFactor: 10.0,
),
Flutter中常用的组件-Center
猜你喜欢
转载自blog.csdn.net/guliang28/article/details/128817938
今日推荐
周排行