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