The easiest solution is to add the isExpanded
property to true
in DropdownButton
For example:
new DropdownButton(
isExpanded: true, //Adding this property, does the magic
items: [
new DropdownMenuItem(
child: Text("Some large text that needs to be wrapped or ellipsized",
overflow: TextOverflow.ellipsis),
),
new DropdownMenuItem(
child: Text("This is another large text that needs to be wrapped or ellipsized",
overflow: TextOverflow.ellipsis),
),
new DropdownMenuItem(
child: Text("And one more large text that needs to be wrapped or ellipsized",
overflow: TextOverflow.ellipsis),
)
],
onChanged: (val) {
//print(val);
}),