selectedItemBuilder property

DropdownButtonBuilder selectedItemBuilder

A builder to customize the dropdown buttons corresponding to the DropdownMenuItems in items.

When a DropdownMenuItem is selected, the widget that will be displayed from the list corresponds to the DropdownMenuItem of the same index in items.

This sample shows a DropdownButton with a button with Text that corresponds to but is unique from DropdownMenuItem.
final List<String> items = <String>['1','2','3'];
String selectedItem = '1';

Widget build(BuildContext context) {
  return Padding(
    padding: const EdgeInsets.symmetric(horizontal: 12.0),
    child: DropdownButton<String>(
      value: selectedItem,
      onChanged: (String string) => setState(() => selectedItem = string),
      selectedItemBuilder: (BuildContext context) {
        return<Widget>((String item) {
          return Text(item);
      items: item) {
        return DropdownMenuItem<String>(
          child: Text('Log $item'),
          value: item,

If this callback is null, the DropdownMenuItem from items that matches value will be displayed.


final DropdownButtonBuilder selectedItemBuilder