DartPad示例在这里:https://dartpad.dev/cf6ab1d34f5b1022aa48ea8ced193de5。
我正在尝试显示分数,但无法获得作为分数栏的容器,因此无法展开到整个屏幕。这是我现在拥有的代码:
Center(
child: Column(
children: <Widget>[
Text("100"),
Container(
height: 2,
color: Colors.black,
),
Text("300"),
],
),
)
最佳答案
IntrinsicWidth(
child: Column(
children: [
Text("100"),
Container(
height: 2,
color: Colors.black,
),
Text("300"),
],
),
)
关于flutter - 使“列强制容器”与其他小部件的大小相同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59364779/