0

こんにちは、私はビルドとUIをしようとしています

題名

画像

説明

しかし、私のタイトルは2つの大きな主に2行であるため、EXCEPTION CAUGHT BY RENDERING LIBRARY 私のコードは以下のとおりです。

Widget _buildRowItem() {
    final Row mainRow = new Row(
      mainAxisAlignment: MainAxisAlignment.start,
      children: <Widget>[
        new Text(_feed.getTitle(),
            maxLines: 2, softWrap: true, textAlign: TextAlign.start),
      ],
    );
    final Container container = new Container(
      child: mainRow,
      padding: const EdgeInsets.all(4.0),
      color: Colors.teal,
    );

    return container;
  }

出力: ここに画像の説明を入力

4

3 に答える 3

1

あなたのアプローチでほとんどそこにいます!

柔軟なラッパーを追加して完了です。

ここに画像の説明を入力

  Widget _buildRowItem() {
final Row mainRow = new Row(
  mainAxisAlignment: MainAxisAlignment.start,
  children: <Widget>[
    new Flexible(child: new Text('some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text some text ',
        maxLines: 2, softWrap: true, textAlign: TextAlign.start))

  ],
);
final Container container = new Container(
  child: mainRow,
  padding: const EdgeInsets.all(4.0),
  color: Colors.teal,
);

return container;

}

于 2018-04-15T10:55:50.843 に答える