【发布时间】:2021-01-11 03:43:10
【问题描述】:
我想在屏幕上创建一个很长的段落。 小部件必须是可滚动的,因为它的末尾会有一个按钮。
class CloseForm extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
extendBody: true,
backgroundColor: Colors.black,
body: SingleChildScrollView(
child: SafeArea(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
SizedBox(height: 20.0),
Text("TEXT 1"),
Text("TEXT 2"),
Text("TEXT 3"),
Text("TEXT 4"),
SizedBox(height: 250.0),
Center(
child: ButtonTheme(
child: RaisedButton(
onPressed: () => print("Connect"),
elevation: 2.0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
child: Text(
"Accepter",
style: TextStyle(
color: Colors.white,
fontSize: 20.0,
fontWeight: FontWeight.w600),
),
color: Color(0xFF5ABA9F),
),
),
),
],
),
),
),
);
}
}
如果继续使用 TEXT 小部件插入每一行,这将非常累我只想知道是否有可能一步插入整个段落,谢谢
【问题讨论】: