How can I give a constant width to a DropDownButton in a Flutter?
As I got to know why they both DropDownButton as different width size in below image, as 1st one as the highest length of value "100%" in it & the 2nd one as highest value as "90%" in it, so there is a difference in the length of the string so it wrapping accordingly.
I want to give a fixed width for them so that they look the same.
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Text(title,
style: Theme.textTheme.body1
.copyWith(fontWeight: ThemeData.medium)),
DropdownButton(
disabledHint: Text(defaultValue),
value: currentDropDownItem,
items: dropDownItemList,
onChanged: isEnabled
? (value) {
if (onValueChanged != null) {
onValueChanged(value);
}
}
: null,
),
])