Wrap

2020-08-07  本文已影响0人  不二客

Wrap

 Wrap({
    Key key,
    this.direction = Axis.horizontal,//两个维度上的两个基本方向。
    this.alignment = WrapAlignment.start, //子控件在主轴上的对齐方式
    this.spacing = 0.0,  //主轴上子控件中间的间距
    this.runAlignment = WrapAlignment.start, // 子控件在交叉轴上的对齐方式
    this.runSpacing = 0.0, // 交叉轴上子控件之间的间距
    this.crossAxisAlignment = WrapCrossAlignment.start, //交叉轴上子控件的对齐方式
    this.textDirection,
    this.verticalDirection = VerticalDirection.down,
    List<Widget> children = const <Widget>[],
  }) 

WrapAlignment

start 将子控件放在主轴的开始位置
end 将子控件放在主轴的结束位置
center 将子控件放在主轴的中间位置
spaceBetween 空白区域均分 首尾child都靠近首尾
spaceAround 空白区域均分 首尾child的空白区域为1/2
spaceEvenly 空白区域均分 包括首尾

WrapCrossAlignment

start 将子控件放在交叉轴的起始位置
end 将子控件放在交叉轴的结束位置
center 将子控件放在交叉轴的中间位置

上一篇下一篇

猜你喜欢

热点阅读