Is it possible to edit the square from the DropDownMenuEntry in Flutter? My actual source code::
<code>Container(
width: screenWidth / 10,
height: screenHeight / 22,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white,
),
child: DropdownButtonFormField<String>(
style: TextStyle(
fontSize: 18,
color: Colors.black,
),
alignment: Alignment.center,
decoration: InputDecoration(
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: BorderSide.none,
),
filled: true,
fillColor: Colors.transparent,
),
dropdownColor: Colors.white,
items: <DropdownMenuItem<String>>[
DropdownMenuItem(
value: 'value1',
child: Text('Label 1'),
),
DropdownMenuItem(
value: 'value2',
child: Text('Label 2'),
),
// Add more items here as needed
],
onChanged: (String? newValue) {
setState(() {
//selectedValue = newValue;
});
},
icon: Icon(Icons.arrow_drop_down),
iconEnabledColor: Colors.black,
iconSize: 24,
),
);
</code>
<code>Container(
width: screenWidth / 10,
height: screenHeight / 22,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white,
),
child: DropdownButtonFormField<String>(
style: TextStyle(
fontSize: 18,
color: Colors.black,
),
alignment: Alignment.center,
decoration: InputDecoration(
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: BorderSide.none,
),
filled: true,
fillColor: Colors.transparent,
),
dropdownColor: Colors.white,
items: <DropdownMenuItem<String>>[
DropdownMenuItem(
value: 'value1',
child: Text('Label 1'),
),
DropdownMenuItem(
value: 'value2',
child: Text('Label 2'),
),
// Add more items here as needed
],
onChanged: (String? newValue) {
setState(() {
//selectedValue = newValue;
});
},
icon: Icon(Icons.arrow_drop_down),
iconEnabledColor: Colors.black,
iconSize: 24,
),
);
</code>
Container(
width: screenWidth / 10,
height: screenHeight / 22,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white,
),
child: DropdownButtonFormField<String>(
style: TextStyle(
fontSize: 18,
color: Colors.black,
),
alignment: Alignment.center,
decoration: InputDecoration(
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: BorderSide.none,
),
filled: true,
fillColor: Colors.transparent,
),
dropdownColor: Colors.white,
items: <DropdownMenuItem<String>>[
DropdownMenuItem(
value: 'value1',
child: Text('Label 1'),
),
DropdownMenuItem(
value: 'value2',
child: Text('Label 2'),
),
// Add more items here as needed
],
onChanged: (String? newValue) {
setState(() {
//selectedValue = newValue;
});
},
icon: Icon(Icons.arrow_drop_down),
iconEnabledColor: Colors.black,
iconSize: 24,
),
);
I am doing a research but I didn’t find anything.
Yes, add borderRadius
as a property of the DropdownButtonFormField. It is different from the borderRadius defined in the decoration property.
<code>decoration: InputDecoration(
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: BorderSide.none,
),
borderRadius: BorderRadius.circular(12),
</code>
<code>decoration: InputDecoration(
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: BorderSide.none,
),
borderRadius: BorderRadius.circular(12),
</code>
decoration: InputDecoration(
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: BorderSide.none,
),
borderRadius: BorderRadius.circular(12),