selectedItemBuilder property

DropdownButtonBuilder? selectedItemBuilder
final

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.

{@tool dartpad --template=stateful_widget_scaffold}

This sample shows a DropdownButton with a button with Text that corresponds to but is unique from DropdownMenuItem.

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

Implementation

final DropdownButtonBuilder? selectedItemBuilder;