美文网首页
2020-05-13 Flutter Flex

2020-05-13 Flutter Flex

作者: rub1cky | 来源:发表于2020-05-13 08:49 被阅读0次

构造函数

Flex({
    Key key,
    @required this.direction, // 轴向
    this.mainAxisAlignment = MainAxisAlignment.start, // 主轴方向对齐方式
    this.mainAxisSize = MainAxisSize.max, // 主轴尺寸
    this.crossAxisAlignment = CrossAxisAlignment.center, // 交叉轴方向对齐方式
    this.textDirection,
    this.verticalDirection = VerticalDirection.down, // 垂直排序
    this.textBaseline,
    List<Widget> children = const <Widget>[],
  })

DEMO

截屏2020-05-13 上午8.48.59.png
Flex(
      mainAxisAlignment: MainAxisAlignment.center,
      direction: Axis.horizontal,
      children: <Widget>[
        Container(
          width: 100,
          height: 50,
          color: Colors.yellow,
        ),
        Container(
          width: 50,
          height: 100,
          color: Colors.green,
        ),
        Container(
          width: 100,
          height: 50,
          color: Colors.red,
        )
      ],
    );

相关文章

网友评论

      本文标题:2020-05-13 Flutter Flex

      本文链接:https://www.haomeiwen.com/subject/icygnhtx.html