Closed giordy16 closed 4 months ago
I want to implement a DropdownButtonFormField2 with an OutlineInputBorder border. This is the code:
DropdownButtonFormField2
OutlineInputBorder
return DropdownButtonFormField2( items: values.map<DropdownMenuItem>((entity) { return DropdownMenuItem( value: entity, child: Text( entity.toString(), ), ); }).toList(), onChanged: (value) { if (onItemSelected != null) { onItemSelected!(value); } }, decoration: InputDecoration( label: Text(title), labelStyle: TextStyle(color: theme.colorScheme.secondary), errorBorder: formErrorBorder(context), focusedBorder: formFocusedBorder(context), enabledBorder: formEnabledBorder(context), focusedErrorBorder: formFocusedBorder(context), ), validator: isMandatory ? mandatoryFieldDynamic() : null, value: initialValue, );
And this is the result:
I would like to have "Liquidità" (the selected value of the dropdown) to be aligned with the label on the border and the other dropdown values, but I am playing with the different paddings and I can't achieve what I want.
Any suggestions?
Check https://github.com/AhmedLSayed9/dropdown_button2/issues/237
thank you, this helped https://stackoverflow.com/a/77971775/14036990
I want to implement a
DropdownButtonFormField2
with anOutlineInputBorder
border. This is the code:And this is the result:
I would like to have "Liquidità" (the selected value of the dropdown) to be aligned with the label on the border and the other dropdown values, but I am playing with the different paddings and I can't achieve what I want.
Any suggestions?