AuiDropdown<T> class

A styled dropdown selector widget built on DropdownButtonFormField.

Mirrors the look and feel of AuiTextField.outlined (and AuiTextField.filled via the AuiDropdown.filled constructor).

// Outlined (default)
AuiDropdown<String>(
  label: 'Country',
  hint: 'Select a country',
  items: const [
    AuiDropdownItem(value: 'us', label: 'United States'),
    AuiDropdownItem(value: 'gb', label: 'United Kingdom'),
  ],
  value: _selected,
  onChanged: (v) => setState(() => _selected = v),
)

// Filled variant
AuiDropdown<String>.filled(...)
Inheritance

Constructors

AuiDropdown({Key? key, required List<AuiDropdownItem<T>> items, required ValueChanged<T?>? onChanged, T? value, String? hint, String? label, String? error, bool disabled = false, double? borderRadius})
Creates an outlined AuiDropdown (default variant).
const
AuiDropdown.filled({Key? key, required List<AuiDropdownItem<T>> items, required ValueChanged<T?>? onChanged, T? value, String? hint, String? label, String? error, bool disabled = false, double? borderRadius})
Creates a filled AuiDropdown.
const

Properties

borderRadius double?
Override for the border radius.
final
disabled bool
Whether the entire dropdown is non-interactive. Defaults to false.
final
error String?
When non-null, renders the string as an error message below the field and highlights the border in the error color.
final
hashCode int
The hash code for this object.
no setterinherited
hint String?
Hint text shown when no value is selected.
final
items List<AuiDropdownItem<T>>
The list of items shown in the dropdown menu.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
label String?
Floating label text shown above the dropdown field.
final
onChanged ValueChanged<T?>?
Called when the user selects a different 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

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

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