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
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- VitComboBox
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, Widget optionsBuilder(Set<T> options)?, void onClose()?, Widget? trailing, TextStyle? labelStyle, Offset? optionsOffset, BoxDecoration overlayDecorationBuilder(double height)?, RenderBox? getParentRenderBox()?, bool enabled = true, double? optionsContainerHeight})
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
- getParentRenderBox → RenderBox? Function()?
-
Used to calculate the options overlay position.
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
- labelStyle → TextStyle?
-
The style of the label.
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
- optionsOffset → Offset?
-
The offset used to adjust the position of the options overlay.
final
- overlayDecorationBuilder → BoxDecoration Function(double height)?
-
The decoration of the overlay container displayed onTap.
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