【发布时间】:2020-08-18 02:08:58
【问题描述】:
我是 Flutter 的新手,最近我遇到了一个场景,我必须不雅地对齐行中的元素。我有 3 个子元素,我们称之为 A、B 和 C。我的要求是 A 和 B 位于行的最左侧,元素 C 位于最右侧。
我的代码:
Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
CircleAvatar(
backgroundImage: NetworkImage(''),
radius: 30,
),
SizedBox(
width: 10,
),
Flexible(
child: Text('name', overflow: TextOverflow.ellipsis,),
),
SizedBox(
width: 10,
),
Container(
child: ButtonTheme(
height: 25.0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(100.0)),
child: RaisedButton(
child: Text(
'Challenge',
style: TextStyle(color: Colors.white, fontSize: 12),
),
onPressed: () {},
),
),
),
],
),
任何人都可以帮我解决这个问题。提前致谢。
【问题讨论】: