I have a dropdown button and it has rounded edges. Now, how do I make the list which pops up when the dropdown is clicked have rounded edges as well ?
Image of dropdown:
Image of list which pops up when dropdown is clicked (I want to make these edges rounded like my dropdown button):
My code:
return Theme(
data: ThemeData(canvasColor: cardBlueColor, brightness: Brightness.dark),
child:Container(
width:MediaQuery.of(context).size.width/1.25,
child:Card(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15.0)),
color: cardBlueColor,
elevation: 8.0,
child:DropdownButtonHideUnderline(
child: ButtonTheme(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15.0)),
alignedDropdown: true,
child: DropdownButton(
elevation: 8,
icon: Icon(Icons.keyboard_arrow_down),
value: _dateSelected,
hint: AutoSizeText(NA_FLIGHT_PAGE_DROPDOWN, style: TextStyle(color: white,),textAlign: TextAlign.center,),
isDense: false,
onChanged: (String newValue){
setState(() {
_dateSelected = newValue;
dropdownMap = _getDropdownMap(snapshot);
});
},
items: dropdownList.map((key){
return DropdownMenuItem<String>(
value: key.toString(),
child: AutoSizeText(key.toString(), style: TextStyle(color: white,),textAlign: TextAlign.center,),
);
}).toList(),
),
),
)
)
)
);
What I've tried:
// adding a shape to the button theme
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15.0))
// using a container with radius and making canvas transparent
data: ThemeData(canvasColor: transparent, brightness: Brightness.dark),
// omitted code
return DropdownMenuItem<String>(
value: key.toString(),
child: Container(
decoration: BoxDecoration(color:cardBlueColor, borderRadius: BorderRadius.all(Radius.circular(10))),
child: AutoSizeText(key.toString(), style: TextStyle(color: white,),textAlign: TextAlign.center,),
)
);
Image of container with transparent canvas color method as suggested:



