Flutterでなにも指定しなければテキストは突き抜けてしまいます。
例えばこんなコード
new Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
new Container(
padding: new EdgeInsets.all(5.0),
child: new Text(
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
style: new TextStyle(fontWeight: FontWeight.bold),
),
),
new DefaultTextStyle(
style: new TextStyle(color: Colors.black),
overflow: TextOverflow.ellipsis,
child: new Padding(
child: new Text("ああああああああああああああああああああああああああああああ"),
padding: new EdgeInsets.only(top: 10.0),
)),
],
)
![スクリーンショット 2018-05-16 14.34.57.png](https://qiita-user-contents.imgix.net/https%3A%2F%2Fqiita-image-store.s3.amazonaws.com%2F0%2F139360%2F82f01425-727d-f754-c6e4-12622d9ed332.png?ixlib=rb-4.0.0&auto=format&gif-q=60&q=75&s=05dadf2063716bd67c6e0e4f2a0f2b24)
Flexibleを使う
Flexible
を使うと中のテキストをその中のWidgetをラップするのでテキストが改行されずに表示されるようになります。
new Flexible(
child: new Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
new Container(
padding: new EdgeInsets.all(5.0),
child: new Text(
document["title"],
softWrap: true,
style: new TextStyle(fontWeight: FontWeight.bold),
),
),
new DefaultTextStyle(
style: new TextStyle(color: Colors.black),
overflow: TextOverflow.ellipsis,
maxLines: 3,
child: new Padding(
child: new Text(document["description"]),
padding: new EdgeInsets.only(top: 10.0),
)),
],
),
)
![スクリーンショット 2018-05-16 14.39.59.png](https://qiita-user-contents.imgix.net/https%3A%2F%2Fqiita-image-store.s3.amazonaws.com%2F0%2F139360%2F425273d6-8e66-0992-a021-0f0ff52dfec3.png?ixlib=rb-4.0.0&auto=format&gif-q=60&q=75&s=e45fcdaa33c2d0144bb8a66eb3b3b573)
maxLines: 3,
みたいな指定もすると3行だけ表示して残りは ...
みたいなこともしてくれます。