直播平台软件开发,flutter Wrap 自动换行组件

直播平台软件开发,flutter Wrap 自动换行组件

先来简单的看一下源码

 

1
<br>Wrap({<br>    super.key,<br>    this.direction = Axis.horizontal,<br>    this.alignment = WrapAlignment.start,<br>    this.spacing = 0.0,<br>    this.runAlignment = WrapAlignment.start,<br>    this.runSpacing = 0.0,<br>    this.crossAxisAlignment = WrapCrossAlignment.start,<br>    this.textDirection,<br>    this.verticalDirection = VerticalDirection.down,<br>    this.clipBehavior = Clip.none,<br>    super.children,<br>  }) : assert(clipBehavior != null);<br> 

从上面的源码中,我们可以看到,Wrap 组件没有必传属性,但是我们在使用的时候,往往需要传入 子child 的上下间距,direction 布局方向,开始样式等相关属性

 

1
<br> Wrap(<br>              direction: Axis.horizontal,<br>              alignment: WrapAlignment.start,<br>              spacing: 5.0,<br>              runSpacing: 5.0,<br>              children: [<br>                Container(<br>                  width: 100,<br>                  height: 100,<br>                  color: Colors.red,<br>                ),<br>                Container(<br>                  width: 100,<br>                  height: 100,<br>                  color: Colors.yellow,<br>                ),<br>                Container(<br>                  width: 100,<br>                  height: 100,<br>                  color: Colors.green,<br>                ),<br>                Container(<br>                  width: 100,<br>                  height: 100,<br>                  color: Colors.red,<br>                ),<br>              ],<br>            )

 

 以上就是 直播平台软件开发,flutter Wrap 自动换行组件,更多内容欢迎关注之后的文章

 

posted @   云豹科技-苏凌霄  阅读(25)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 25岁的心里话
· 按钮权限的设计及实现
历史上的今天:
2021-12-14 直播系统源代码,按钮图片和文字位置的各种设置
2021-12-14 短视频app源码,实现原生js图片预览效果
2021-12-14 android短视频开发,仿三方软件列表滑动
点击右上角即可分享
微信分享提示