VitComboBox<T> class

A widget similar to a text box, but on tap, a overlay of options is shown below it, allowing the user to choose an option.

Inheritance

Constructors

VitComboBox.itemBuilder({required Set<T> options, required Widget itemBuilder(T item), required FutureOr<bool?> onSelected(T key), Widget selectedItemBuilder(T? selection)?, void onClose()?, String? label, VitComboBoxStyle? style, T? selection, Widget? trailing, bool enabled = true})
Creates a combobox with option overlay using the ListView and itemBuilder.
factory
VitComboBox.rawBuilder({required Widget optionsBuilder(OverlayEntry entry), required Widget selectedItemBuilder(), void onClose()?, String? label, VitComboBoxStyle? style, T? selection, Widget? trailing, bool enabled = true})
Creates a combobox with a custom option overlay by providing optionsBuilder.
factory

Properties

enabled bool
Indicates to the user whether the widget is interactiable or not.
final
hashCode int
The hash code for this object.
no setterinherited
itemBuilder Widget Function(T item)?
The builder from each item inside options. If optionsBuilder is given, then this parameter must not be provided.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
label String?
The text displayed above it so indicate to the user with field this component belongs to
final
onClose → void Function()?
Invoked when the overlay is closed.
final
onSelected FutureOr<bool?> Function(T key)?
The callback invoked when an option is selected. You can prevent the overlay from closing by returning false.
final
options Set<T>?
The options used to create the options overlay.
final
optionsBuilder Widget Function(OverlayEntry entry)?
Optional parameter to build a custom layout when the widget is selected.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectedItemBuilder Widget Function(T? selection)?
Optional parameter to build the current selection inside the widget.
final
selection → T?
The current item selected between options.
final
style VitComboBoxStyle?
A group of properies relating to the component style.
final
trailing Widget?
The widget shown at the end of the widget.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<VitComboBox>
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}) 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