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({Key? key, required Set<T> options, String? label, T? selection, Widget itemBuilder(T item)?, FutureOr<bool?> onSelected(T key)?, Widget selectedItemBuilder(T? selection)?, BoxDecoration? decoration, double? height, bool enabled = true, Widget optionsBuilder(Set<T> options)?, void onClose()?, double optionsContainerHeight = 150, Widget? trailing})
VitComboBox.chip({required Set<T> options, required Widget itemBuilder(T item), required FutureOr<bool?> onSelected(T key), String? label, T? selection, double? height})
factory

Properties

decoration BoxDecoration?
The decoration for the container of the widget
final
enabled bool
Indicates to the user whether the widget is interactiable or not.
final
hashCode int
The hash code for this object.
no setterinherited
height double?
The height of the widget.
final
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 to display to the user
final
optionsBuilder Widget Function(Set<T> options)?
Optional parameter to build a custom layout when the widget is selected.
final
optionsContainerHeight double
The height of the options container displayed when the user selects the widget.
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
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