Flutter--Wrap组件
  45VoiS2mj7n5 2023年11月02日 24 0


属性

属性

释义

direction

主轴的方向默认为水平

alignment

主轴的对齐方式

spacing

主轴方向上的间距

textDirection

文本方向

verticlaDirection

children的摆放方向

runAlignment

新的行或者新的列

runSpacing

run的间距

class HomeContent extends StatelessWidget {
@override
Widget build(BuildContext context) {
// TODO: implement build
return Wrap(
spacing:10,
runSpacing: 10,
direction: Axis.vertical,
alignment:WrapAlignment.center,
runAlignment: WrapAlignment.spaceEvenly,
children: <Widget>[
MyButton("第1集"),
MyButton("第2集"),
MyButton("第3集"),
MyButton("第4集"),
MyButton("第5集"),
MyButton("第6集"),
MyButton("第7集"),
MyButton("第8集"),
MyButton("第9集"),
MyButton("第10集"),
MyButton("第11集"),
MyButton("第3集"),
MyButton("第4集"),
MyButton("第5集"),
MyButton("第6集"),
MyButton("第7集"),
MyButton("第8集"),
MyButton("第9集"),
MyButton("第10集"),
MyButton("第11集"),
],
);
}
}

class MyButton extends StatelessWidget{
final String text;
const MyButton(this.text);
@override
Widget build(BuildContext context) {
// TODO: implement build
return RaisedButton(
child: Text(this.text),
textColor:Theme.of(context).accentColor,
onPressed: (){
}
);
}
}

Flutter--Wrap组件_flutter


Flutter--Wrap组件_dart_02


【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月08日 0

暂无评论

推荐阅读
  b1UHV4WKBb2S   2023年11月13日   29   0   0 flutterDart
  zSWNgACtCQuP   2023年11月13日   32   0   0 ide
45VoiS2mj7n5