使用颤振显示多行中的芯片和文本

时间:2018-06-15 13:23:40

标签: flutter flutter-layout

我正在尝试在一行内的多行中显示芯片和长行文字。

This is wrong

I want it like this, except for the label and the aligned on the same line.

我目前的代码:

        return new Column(
          mainAxisSize: MainAxisSize.max,
          children: <Widget>[
            new Wrap(
              spacing: 8.0,
              runSpacing: 4.0,
              direction: Axis.horizontal,
              children: <Widget>[
                new Tag(tagLabel: 'Chip1'),
                new Text('This is a very, very long text that should wrap. The second line should be shown below the first chip!'),
                new Chip(label: new Text('Chip2')),
                new Chip(label: new Text('Chip3')),
                new Chip(label: new Text('Chip4')),
                new Chip(label: new Text('Chip5')),
                new Chip(label: new Text('Chip6'))
              ],
            )
          ],
        );

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

您需要将“标记1”和“文本1”包装在一行中,并全部包装在“列”中。并对芯片尺寸进行一些调整。默认情况下,它会展开屏幕上的所有行。