如果我想在Row
中制造两个或更多的Buttons
来拥有相同的Width
,我该怎么做呢?
例如,我有三个标题不同的RaisedButtons
,比如Approve
、Reject
和Need Revise
,如果我把这三个Button
放在Row
中,它们会有不同的Width
,我不想要它.
我需要的是他们有同样的Width
号.
如果我想在Row
中制造两个或更多的Buttons
来拥有相同的Width
,我该怎么做呢?
例如,我有三个标题不同的RaisedButtons
,比如Approve
、Reject
和Need Revise
,如果我把这三个Button
放在Row
中,它们会有不同的Width
,我不想要它.
我需要的是他们有同样的Width
号.
你可以用Row
和Expanded
来包装你的子元素:
Row(
children: <Widget>[
Expanded(
child: RaisedButton(
child: Text('Approve'),
onPressed: () => null,
),
),
Expanded(
child: RaisedButton(
child: Text('Reject'),
onPressed: () => null,
),
),
Expanded(
child: RaisedButton(
child: Text('Need Revise'),
onPressed: () => null,
),
)
],
);