StacDropdownMenu class

A Stac model representing Flutter's DropdownMenu widget.

Shows a Material dropdown with a text field and selectable entries.

{@tool snippet} Dart Example:

const StacDropdownMenu(
  enabled: true,
  hintText: 'Select an item',
  dropdownMenuEntries: [
    StacDropdownMenuEntry(label: 'One', value: '1'),
    StacDropdownMenuEntry(label: 'Two', value: '2'),
  ],
)

{@end-tool}

{@tool snippet} JSON Example:

{
  "type": "dropdownMenu",
  "hintText": "Select an item",
  "dropdownMenuEntries": [
    {"label": "One", "value": "1"},
    {"label": "Two", "value": "2"}
  ]
}

{@end-tool}

See also:

Inheritance
Annotations
  • @JsonSerializable.new()

Constructors

StacDropdownMenu({bool? enabled, double? width, double? menuHeight, StacWidget? leadingIcon, StacWidget? trailingIcon, StacWidget? label, String? hintText, String? helperText, String? errorText, StacWidget? selectedTrailingIcon, bool? enableFilter, bool? enableSearch, StacTextInputType? keyboardType, StacTextStyle? textStyle, StacTextAlign? textAlign, StacInputDecorationTheme? inputDecorationTheme, List<StacInputFormatter>? inputFormatters, StacOffset? alignmentOffset, StacEdgeInsets? expandedInsets, bool? requestFocusOnTap, dynamic initialSelection, List<StacDropdownMenuEntry>? dropdownMenuEntries, StacDropdownMenuCloseBehavior? closeBehavior})
Creates a StacDropdownMenu.
const
StacDropdownMenu.fromJson(Map<String, dynamic> json)
Creates a StacDropdownMenu from a JSON map.
factory

Properties

alignmentOffset → StacOffset?
Offset applied to align menu overlay.
final
closeBehavior → StacDropdownMenuCloseBehavior?
Close behavior for the menu.
final
Entries to display in the dropdown.
final
enabled → bool?
Whether the dropdown is interactive.
final
enableFilter → bool?
Whether to enable client-side filtering.
final
enableSearch → bool?
Whether to show a search field for filtering.
final
errorText → String?
Error text displayed below the field.
final
expandedInsets → StacEdgeInsets?
Insets to apply when expanded.
final
hashCode → int
The hash code for this object.
no setterinherited
helperText → String?
Helper text displayed below the field.
final
hintText → String?
Hint text shown inside the field when it is empty.
final
initialSelection → dynamic
The initial selected value.
final
inputDecorationTheme → StacInputDecorationTheme?
Input decoration theme.
final
inputFormatters → List<StacInputFormatter>?
Input formatters to apply to user input.
final
jsonData → Map<String, dynamic>?
Raw JSON data for this widget
finalinherited
keyboardType → StacTextInputType?
Keyboard type for the text field.
final
label → StacWidget?
Optional label widget.
final
leadingIcon → StacWidget?
Leading icon widget.
final
The maximum height of the menu overlay.
final
requestFocusOnTap → bool?
Whether the field should request focus on tap.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
selectedTrailingIcon → StacWidget?
Icon shown when an item is selected.
final
textAlign → StacTextAlign?
How the text should be aligned horizontally.
final
textStyle → StacTextStyle?
Text style for the input value.
final
trailingIcon → StacWidget?
Trailing icon widget.
final
type → String
Widget type identifier.
no setteroverride
width → double?
The width of the dropdown.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Converts this StacDropdownMenu instance to a JSON map.
override
toString() → String
A string representation of this object.
inherited

Operators

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