【发布时间】:2019-05-07 03:38:01
【问题描述】:
如何将文本小部件包装在步进小部件字幕中?,这些是我所做的一些尝试,但没有成功:
return Scaffold(
body: Stepper(
steps: [
Step(
title: Text("fake title"),
subtitle: Text(
"This text should be only one line, if flutter is showing an error and you are tired of trying to find a solution, start praying.",
overflow: TextOverflow.ellipsis,
maxLines: 1,
softWrap: true,
),
content: Text("fake content")),
],
));
并带有可扩展或灵活的小部件:
return Scaffold(
body: Stepper(
steps: [
Step(
title: Text("fake title"),
subtitle: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Expanded(
child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Text(
"This text should be only one line, if flutter is showing an error and you are tired of trying to find a solution, start praying.",
overflow: TextOverflow.ellipsis,
maxLines: 1,
softWrap: true,
),
],
),
)
],
),
content: Text("fake content")),
],
));
我实现的唯一方法是使用 Container 小部件,但我必须指定固定宽度,所以它没有响应。
【问题讨论】: