【发布时间】:2020-05-08 08:18:17
【问题描述】:
我需要将我的flutter 应用程序的dropdown 对齐到最右边。它已经对齐,但在我的实际应用程序中,我有多个 dropdowns 一个在另一个之下。菜单项的长度在所有下拉列表中都不会相似。所以我需要将所有这些对齐到最右边。
下面是我的代码。
Row(
children: <Widget>[
Expanded(
flex: 1,
child: Container(
margin: EdgeInsets.only(left: 10),
child: Text(
"Size: ",
style: Theme.of(context).textTheme.subhead,
),
),
),
Expanded(
flex: 3,
child: DropdownButton(
hint: Text(
"Please Select ",
style: TextStyle(
fontSize: 14,
),
),
items: <String>[
'Skinless Boneless, Full Loins',
'brown',
'silver'
].map((data) {
return DropdownMenuItem(
child: new Text(data,
style: TextStyle(
fontSize: 14,
)),
value: data,
);
}).toList(),
onChanged: (String newValue) {
setState(() {
_sizedropDown = newValue;
print(newValue);
});
},
value: _sizedropDown,
),
)
],
)
我该怎么做?
【问题讨论】:
标签: android ios flutter mobile