大家好,我是 Flutter 的新手,我尝试在水平线上编写 OR
,如图所示,但我不知道该怎么做,我尝试用谷歌搜索,但没有成功帮助过我
example demonstration
注: OR 居中
最佳答案
试试下面的代码希望对你有帮助。您必须使用这种(-- 或 -- )类型的设计 Expanded 或 Flexible Widget
去here对于 Expanded Widget 和 here用于灵活小部件
Padding(
padding: EdgeInsets.all(8.0),
child: Row(
children: [
Expanded(
child: Divider(
color: Colors.black,
thickness: 1,
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text('OR'),
),
Expanded(
child: Divider(
color: Colors.black,
thickness: 1,
),
),
],
),
),
你的结果屏幕像 ->
https://stackoverflow.com/questions/69153957/