container

This commit is contained in:
结发受长生 2019-10-26 19:07:17 +08:00
parent 6e0600c30c
commit 7627681b1e

View File

@ -130,4 +130,20 @@ Text(
decorationStyle: TextDecorationStyle.solid // 下划线类型
)
)
```
```
#### 容器组件
就是`Container`类以及它的一些子类
可以简单理解为div通常用来方便控制布局
```dart
Container(
child: Text(
'这是一段文字',
style: TextStyle(fontSize: 40),
),
alignment: Alignment.bottomLeft, // 底部居左对齐
color: Color.fromARGB(255, 50, 50, 50), //内部文字的颜色
margin: EdgeInsets.fromLTRB(10, 20, 10, 30), // 左 上 右 下
)
```
属性也都很容易理解,可以设置容器的宽高,内外边距等等