我有以下代码呈现 aListTile
与 aTextFormField
和 aListTitle
与 a DropdownButton
。
Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
new Expanded(
child: ListTile(
dense: true,
title: Text(
"Property Name",
style: TextStyle(fontWeight: FontWeight.bold),
),
subtitle: TextFormField(
decoration: InputDecoration(
labelText: 'Enter the property name'
),
),
isThreeLine: true,
)
),
new Expanded(
child: ListTile(
dense: true,
title: Text(
"Contact Name",
style: TextStyle(fontWeight: FontWeight.bold),
),
subtitle: DropdownButton<int>(
items: [
DropdownMenuItem<int>(
value: 1,
child: Text(
"John Smith",
),
),
DropdownMenuItem<int>(
value: 2,
child: Text(
"Jon Doe",
),
),
],
onChanged: (value) {
setState(() {
_value = value;
});
},
value: _value,
hint: Text(
"Select Contact Name",
style: TextStyle(
color: Colors.black,
),
),
),
isThreeLine: true,
)
),
],
),
但它产生以下内容:
有没有办法将联系人姓名的 DropdownButton 底线与属性名称的 ListTile 对齐?有任何想法吗?