只需尝试在下拉按钮周围用固定宽度包装容器。
@override
Widget build(BuildContext context) {
titleController.text = todo.title;
descriptionController.text = todo.description;
TextStyle textStyle = Theme.of(context).textTheme.title;
return Padding(
padding: EdgeInsets.only(top: 35, right: 10, left: 10),
child: Scaffold(
appBar: AppBar(
automaticallyImplyLeading: false,
title: Text('Add New'), //todo.title
),
body: Container(
height: 200,
child: Column(
children: <Widget>[
Container(
// don't forget about height
height: 200,
child: DropdownButton<String>(
isExpanded: true,
items: _priorites.map((String value) {
return DropdownMenuItem<String>(
value: value, child: Text(value));
}).toList(),
style: textStyle,
value: "Low",
onChanged: null,
),
)
],
),
),
),
);
}