Flex({
super.key,
required this.direction, // 弹性布局的方向
this.mainAxisAlignment = MainAxisAlignment.start, // 主轴的对齐方式
this.mainAxisSize = MainAxisSize.max,
this.crossAxisAlignment = CrossAxisAlignment.center,
this.textDirection,
this.verticalDirection = VerticalDirection.down,
this.textBaseline, // NO DEFAULT: we don't know what the text's baseline should be
this.clipBehavior = Clip.none,
super.children,
})
Expanded({
super.key,
super.flex, // 弹性系数,0或null,没有弹性
required super.child,
})
- Row 和 Column都继承自Flex
- Expanded只能作为Flex,Row,Column的孩子
网友评论