Fluent2Combobox<T> class
Fluent 2's Combobox: a text field with the down chevron at its end whose typed words filter the listbox of options under it (the popover, on a phone too, so the keyboard stays up). Down or Up opens the list on the chosen option (else the first in use), every option listed until the words are edited; the arrows then move the active option (the focus ring on it) round the list, past an option out of use; Enter or a press chooses it and the field then says its label; Escape closes the list, and leaving the field puts back the chosen label. An app's search can find the options instead, the list saying "Loading" while it runs and offering "Try again" when it fails. A choice calls onChanged; null draws it disabled. Read as a text field named label.
Fluent2Combobox<String>(label: 'Assignee', hint: 'Type a name', value: owner, options: [for (final p in people) Fluent2Option(p.id, p.name)], onChanged: (v) => setState(() => owner = v))
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- Fluent2Combobox
Constructors
-
Fluent2Combobox({required List<
Fluent2Option< options, required T? value, required ValueChanged<T> >T> ? onChanged, String? label, String? hint, Fluent2InputAppearance appearance = Fluent2InputAppearance.outline, Fluent2InputSize size = Fluent2InputSize.medium, bool invalid = false, String? empty, FocusNode? focusNode, bool autofocus = false, Fluent2Style? style, FutureOr<Iterable< search(String query)?, Duration? debounceDuration, Key? key})Fluent2Option< >T> > -
A combobox of
options: a field that filters them as the user types.const
Properties
- appearance → Fluent2InputAppearance
-
Fluent's
appearance: which of its faces it wears.final - autofocus → bool
-
Whether the control takes focus when it first builds.
final
- debounceDuration → Duration?
-
How long typing rests before search runs: one search a pause, not
one a letter. Null runs it at every change.
final
- empty → String?
-
What the list says when nothing matches the typed words; null is
DesignLocalizations.noResultsLabel.
final
- focusNode → FocusNode?
-
The control's focus node; null makes and disposes its own.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hint → String?
-
The words shown while it is empty.
final
- invalid → bool
-
Whether it shows Fluent's invalid state, its edge in the danger colour.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- label → String?
-
What a screen reader calls the field; null reads the surrounding form
field's label.
final
-
onChanged
→ ValueChanged<
T> ? -
Called with the value of the option chosen; null puts it out of use.
final
-
options
→ List<
Fluent2Option< T> > -
The options, in order.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
search
→ FutureOr<
Iterable< Function(String query)?Fluent2Option< >T> > -
Finds the options for the typed words, in place of filtering
options: an app's own search, at once or on its way. Only the latest
words' answer shows. While it is on its way the list shows a spinner and
"Loading"; when it throws, the list says the search failed and offers
"Try again", which Down reaches, the field keeping the focus.
final
- size → Fluent2InputSize
-
Fluent's
size: how large it is drawn.final - style → Fluent2Style?
-
This field's own look, slot by slot, over the text field theme
(Fluent2ThemeData.textFieldTheme): the slots Fluent2FieldFrame
names.
final
- value → T?
-
The chosen option's value; null leaves the field empty.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< Fluent2Combobox< 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.
override
-
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