RemixSelect<T> class
A customizable select component with data-driven API.
Uses a simple, declarative API with data classes for trigger and items. Form input component for selecting a single value from a dropdown list.
Example
RemixSelect<String>(
trigger: RemixSelectTrigger(placeholder: 'Select a fruit'),
items: [
RemixSelectItem(value: 'apple', label: 'Apple'),
RemixSelectItem(value: 'banana', label: 'Banana'),
RemixSelectItem(value: 'orange', label: 'Orange'),
],
selectedValue: selectedValue,
onChanged: (value) => setState(() => selectedValue = value),
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- RemixSelect
Constructors
-
RemixSelect({Key? key, required RemixSelectTrigger trigger, required List<
RemixSelectItem< items, T? selectedValue, OverlayPositionConfig positioning = const OverlayPositionConfig(side: .bottom, alignment: .center), ValueChanged<T> >T?> ? onChanged, VoidCallback? onOpen, VoidCallback? onClose, bool enabled = true, MouseCursor mouseCursor = SystemMouseCursors.click, String? semanticLabel, bool closeOnSelect = true, FocusNode? focusNode, SelectStyler style = const SelectStyler.create(), SelectSpec? styleSpec}) -
const
Properties
- closeOnSelect → bool
-
Whether to automatically close the dropdown when an item is selected.
final
- enabled → bool
-
Whether the select is enabled and can be interacted with.
final
- focusNode → FocusNode?
-
Optional focus node to control focus behavior.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
items
→ List<
RemixSelectItem< T> > -
The list of selectable items.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- mouseCursor → MouseCursor
-
The mouse cursor for the select trigger.
final
-
onChanged
→ ValueChanged<
T?> ? -
Called when the selected value changes.
final
- onClose → VoidCallback?
-
Called when the dropdown closes.
final
- onOpen → VoidCallback?
-
Called when the dropdown opens.
final
- positioning → OverlayPositionConfig
-
Overlay positioning configuration for the dropdown.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectedValue → T?
-
The currently selected value.
final
- semanticLabel → String?
-
Semantic label for accessibility.
final
- style → SelectStyler
-
The style configuration for the select.
final
- styleSpec → SelectSpec?
-
Optional raw style spec that bypasses fluent style resolution.
final
- trigger → RemixSelectTrigger
-
The trigger data that defines the select's button.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< RemixSelect< T> > -
Creates the mutable state for this widget at a given location in the tree.
override
-
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
Static Properties
-
styleFrom
→ SelectStyler Function({AnimationConfig? animation, SelectContentStyler? content, SelectMenuItemStyler? item, WidgetModifierConfig? modifier, SelectTriggerStyler? trigger, List<
VariantStyle< ? variants})SelectSpec> > -
final