DropdownButton<T> class

A dropdown selector that lets the user choose one item from a list.

Displays the currently selected value and opens a popup menu when activated. Use hint to show placeholder text when no value is selected.

Inheritance

Constructors

Creates a DropdownButton with the given items and onChanged callback.
const

Properties

backgroundColor Color?
The background color of the closed button.
final
The background color of the dropdown menu popup.
final
focusColor Color?
The border color when the button has focus.
final
focusNode FocusNode?
An optional focus node for keyboard navigation.
final
hashCode int
The hash code for this object.
no setterinherited
hint String?
Placeholder text shown when no value is selected.
final
items List<DropdownMenuItem<T>>
The list of menu items to choose from.
final
key Key?
Controls how one widget replaces another in the tree.
finalinherited
onChanged ValueChanged<T?>?
Called when the user selects a new item.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value → T?
The currently selected value, or null if nothing is selected.
final

Methods

createElement() StatefulElement
Creates the Element for this widget.
inherited
createState() State<DropdownButton<T>>
Creates the mutable state for this widget.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited