【发布时间】:2022-11-19 20:08:14
【问题描述】:
body: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.only(top: 20, left: 15, right: 15),
child: Padding(
padding: const EdgeInsets.only(top: 10),
child: ClipRRect(
borderRadius: BorderRadius.circular(15),
child: Container(
height: 500,
color: const Color.fromARGB(255, 35, 35, 35),
child: Padding(
padding: const EdgeInsets.only(top: 20),
child: Column(children: const [
Text(
'Student Space',
style: TextStyle(
color: Colors.white,
fontSize: 30,
fontWeight: FontWeight.bold,
),
),
SizedBox(
height: 20,
),
Text('This is a very very very long text that should be centered just like the first text in this column. I don't want to cut it for each row.',
style: TextStyle(
color: Colors.white,
fontSize: 20,
fontWeight: FontWeight.w400,
),
),
]),
),
),
),
),
),
),
我希望文本看起来就像您在 Word 中将文本居中一样。如果不将每一行的文本拆分为单独的文本,我无法弄清楚如何执行此操作。
【问题讨论】:
标签: flutter flutter-text