flutter-布局

Container

是一个结合了绘制(painting)、定位(positioning)以及尺寸(sizing)widget的widget。
最里层的是child元素

padding 内边距 margin 外边距 Edgelnsets()

decoration BoxDecoration (变框,圆角,渐变,阴影,背景色,背景图片)
alignment 对齐
trasform 变形 Matrix4 (平移 translate rotate scale skew)

默认宽度不是全屏的,可以设置 width: double.infinity

Container({
Key key,
this.alignment,
this.padding,
Color color,
Decoration decoration,
this.foregroundDecoration,
double width,
double height,
BoxConstraints constraints,
this.margin,
this.transform,
this.child,
})

Flex 弹性布局

direction 声明主轴方向

flex 分配占比

流式布局

Wrap 解决内容溢出

Chip 标签
CircleAvatar 圆形头像