我需要一个带有一些文本的容器来自动展开。我有一个 API 调用,可以是 5 个字到 500 个字。我不想只有 1 个很大的固定大小,但包含 10 个单词。
我试过 Expanded() 和 SizedBox.Expand(),但我可能用错了它们
Card(
elevation: defaultTargetPlatform ==
TargetPlatform.android ? 5.0 : 0.0,
child: Column(
children: <Widget>[
Container(
margin: const EdgeInsets.all(0.0),
padding: const EdgeInsets.all(2.0),
decoration: BoxDecoration(color: Colors.black),
width: _screenSize.width,
height: 250,
child: Column(
children: <Widget>[
Container(
color: Colors.black,
width: _screenSize.width,
height: 35,
child: Padding(
padding: const EdgeInsets.only(
left: 15, top: 11),
child: Text("Title".toUpperCase(),
style: TextStyle(
color: Colors.white
),
),
),
),
Container(
color: Colors.white,
width: _screenSize.width,
height: 210,
child: …Run Code Online (Sandbox Code Playgroud)