dart – flterter示例中的Flow Layout

前端之家收集整理的这篇文章主要介绍了dart – flterter示例中的Flow Layout前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我想在flutter中实现流程布局我在sdk中找到了一个名为FLOW的类但是无法找到关于如何使用它的示例代码

这是我想要实现的布局

enter image description here

解决方法

使用 Wrap而不是Flow.

Flow用于更复杂的自定义布局. Wrap是用于实现屏幕截图中布局的内容.

new Wrap(
  spacing: 8.0,// gap between adjacent chips
  runSpacing: 4.0,// gap between lines
  children: <Widget>[
      new Chip(
        avatar: new CircleAvatar(backgroundColor: Colors.blue.shade900,child: new Text('AH')),label: new Text('Hamilton'),),new Chip(
        avatar: new CircleAvatar(backgroundColor: Colors.blue.shade900,child: new Text('ML')),label: new Text('Lafayette'),child: new Text('HM')),label: new Text('Mulligan'),child: new Text('JL')),label: new Text('Laurens'),],)

猜你在找的Flutter相关文章