Flutter——Container组件(容器组件)


名称 功能
alignment
topCenter:顶部居中对齐
topLeft:顶部左对齐
topRight:顶部右对齐
center:水平垂直居中对齐
centerLeft:垂直居中水平居左对齐
centerRight:垂直居中水平居右对齐
bottomCenter 底部居中对齐
bottomLeft:底部居左对齐
bottomRight:底部居右对齐
decoration
decoration: BoxDecoration(
color: Colors.blue,
border: Border.all(
color: Colors.red,
width: 2.0,
),
borderRadius:
BorderRadius.all(
Radius.circular(8.0)
)
)
注意:150就是圆形。
margin
margin 属性是表示 Container 与外部其他
组件的距离。
EdgeInsets.all(20.0),
padding
padding 就 是 Container 的 内 边 距 , 指
Container 边缘与 Child 之间的距离
padding: EdgeInsets.all(10.0)
transform
让 Container 容易进行一些旋转之类的
transform: Matrix4.rotationZ(0.2) 
height
容器高度
width
容器宽度
child
容器子元素


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM