onChanged property

ValueChanged<T?>? onChanged
final

Called when the user selects an item.

If the onChanged callback is null or the list of DropdownButton2.items is null then the dropdown button will be disabled, i.e. its arrow will be displayed in grey and it will not respond to input. A disabled button will display the DropdownButton2.disabledHint widget if it is non-null. If DropdownButton2.disabledHint is also null but DropdownButton2.hint is non-null, DropdownButton2.hint will instead be displayed.

Implementation

final ValueChanged<T?>? onChanged;