FSelectMenuTile<T> class

A tile that, when triggered, displays a list of options for the user to pick from.

A FSelectMenuTile is internally a FormField, therefore it can be used in a Form.

For desktop, an FSelectGroup is generally recommended over this.

See:

Inheritance
Mixed-in types

Constructors

FSelectMenuTile({required Widget title, required List<FSelectTile<T>> menu, FMultiValueControl<T>? selectControl, FPopoverControl popoverControl = const .managed(), ScrollController? scrollController, FSelectMenuTileStyle style(FSelectMenuTileStyle style)?, double? cacheExtent, double maxHeight = .infinity, DragStartBehavior dragStartBehavior = .start, ScrollPhysics physics = const ClampingScrollPhysics(), FItemDivider divider = .full, AlignmentGeometry menuAnchor = .topRight, AlignmentGeometry tileAnchor = .bottomRight, FPortalSpacing menuSpacing = const .spacing(4), FPortalOverflow menuOverflow = .flip, Offset menuOffset = .zero, FPopoverHideRegion menuHideRegion = .excludeChild, VoidCallback? menuOnTapHide, Object? menuGroupId, bool autoHide = true, Widget? label, Widget? description, bool autofocus = false, FocusScopeNode? menuFocusNode, ValueChanged<bool>? menuOnFocusChange, TraversalEdgeBehavior? menuTraversalEdgeBehavior, String? menuBarrierSemanticsLabel, bool menuBarrierSemanticsDismissible = true, String? semanticsLabel, Widget? prefix, Widget? subtitle, ValueWidgetBuilder<Set<T>> detailsBuilder = defaultSelectMenuTileBuilder, Widget? details, Widget? suffix, Map<ShortcutActivator, Intent>? shortcuts, Map<Type, Action<Intent>>? actions, Widget errorBuilder(BuildContext context, String message) = FFormFieldProperties.defaultErrorBuilder, FormFieldSetter<Set<T>>? onSaved, VoidCallback? onReset, FormFieldValidator<Set<T>>? validator, String? forceErrorText, bool enabled = true, AutovalidateMode autovalidateMode = .disabled, Key? key})
Creates a FSelectMenuTile that eagerly builds the menu.
FSelectMenuTile.builder({required Widget title, required FSelectTile<T>? menuBuilder(BuildContext context, int index), int? count, FMultiValueControl<T>? selectControl, FPopoverControl popoverControl = const .managed(), ScrollController? scrollController, FSelectMenuTileStyle style(FSelectMenuTileStyle style)?, double? cacheExtent, double maxHeight = .infinity, DragStartBehavior dragStartBehavior = .start, ScrollPhysics physics = const ClampingScrollPhysics(), FItemDivider divider = .full, AlignmentGeometry menuAnchor = .topRight, AlignmentGeometry tileAnchor = .bottomRight, FPortalSpacing menuSpacing = const .spacing(4), FPortalOverflow menuOverflow = .flip, Offset menuOffset = .zero, FPopoverHideRegion menuHideRegion = .excludeChild, VoidCallback? menuOnTapHide, Object? menuGroupId, bool autoHide = true, Widget? label, Widget? description, bool autofocus = false, FocusScopeNode? menuFocusNode, ValueChanged<bool>? menuOnFocusChange, TraversalEdgeBehavior? menuTraversalEdgeBehavior, String? menuBarrierSemanticsLabel, bool menuBarrierSemanticsDismissible = true, String? semanticsLabel, Widget? prefix, Widget? subtitle, ValueWidgetBuilder<Set<T>> detailsBuilder = defaultSelectMenuTileBuilder, Widget? details, Widget? suffix, Map<ShortcutActivator, Intent>? shortcuts, Map<Type, Action<Intent>>? actions, Widget errorBuilder(BuildContext context, String message) = FFormFieldProperties.defaultErrorBuilder, FormFieldSetter<Set<T>>? onSaved, VoidCallback? onReset, FormFieldValidator<Set<T>>? validator, String? forceErrorText, bool enabled = true, AutovalidateMode autovalidateMode = .disabled, Key? key})
Creates a FSelectMenuTile that lazily builds the menu.
FSelectMenuTile.fromMap(Map<String, T> menu, {required Text title, FMultiValueControl<T>? selectControl, FPopoverControl popoverControl = const .managed(), ScrollController? scrollController, FSelectMenuTileStyle style(FSelectMenuTileStyle style)?, double? cacheExtent, double maxHeight = .infinity, DragStartBehavior dragStartBehavior = .start, ScrollPhysics physics = const ClampingScrollPhysics(), FItemDivider divider = .full, AlignmentGeometry menuAnchor = .topRight, AlignmentGeometry tileAnchor = .bottomRight, FPortalSpacing menuSpacing = const .spacing(4), FPortalOverflow menuOverflow = .flip, Offset menuOffset = .zero, FPopoverHideRegion menuHideRegion = .excludeChild, VoidCallback? menuOnTapHide, Object? menuGroupId, bool autoHide = true, Widget? label, Widget? description, bool autofocus = false, FocusScopeNode? menuFocusNode, ValueChanged<bool>? menuOnFocusChange, TraversalEdgeBehavior? menuTraversalEdgeBehavior, String? menuBarrierSemanticsLabel, bool menuBarrierSemanticsDismissible = true, String? semanticsLabel, Widget? prefix, Widget? subtitle, ValueWidgetBuilder<Set<T>> detailsBuilder = defaultSelectMenuTileBuilder, Widget? details, Widget? suffix, Map<ShortcutActivator, Intent>? shortcuts, Map<Type, Action<Intent>>? actions, Widget errorBuilder(BuildContext context, String message) = FFormFieldProperties.defaultErrorBuilder, FormFieldSetter<Set<T>>? onSaved, VoidCallback? onReset, FormFieldValidator<Set<T>>? validator, String? forceErrorText, bool enabled = true, AutovalidateMode autovalidateMode = .disabled, Key? key})
Creates a FSelectMenuTile with the given menu.
factory

Properties

actions Map<Type, Action<Intent>>?
The actions. Defaults to selecting a tile when ActivateIntent is invoked.
final
autofocus bool
True if this widget will be selected as the initial focus when no other node in its scope is currently focused.
final
autoHide bool
True if the menu should be automatically hidden after a menu option is selected. Defaults to true.
final
autovalidateMode AutovalidateMode
If AutovalidateMode.onUserInteraction, this FormField will only auto-validate after its content changes. If AutovalidateMode.always, it will auto-validate even without user interaction. If AutovalidateMode.disabled, auto-validation will be disabled.
final
cacheExtent double?
The menu's cache extent in logical pixels.
final
description Widget?
The description.
final
details Widget?
The details.
final
detailsBuilder ValueWidgetBuilder<Set<T>>
An optional builder which returns the details.
final
divider FItemDivider
The divider between select tiles. Defaults to FItemDivider.indented.
final
dragStartBehavior DragStartBehavior
Determines the way that the menu's drag start behavior is handled. Defaults to DragStartBehavior.start.
final
enabled bool
Whether the form field is enabled. Defaults to true.
final
errorBuilder Widget Function(BuildContext context, String message)
The builder for errors displayed below the description. Defaults to displaying the error message.
final
forceErrorText String?
An optional property that forces the FormFieldState into an error state by directly setting the FormFieldState.errorText property without running the validator function.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
label Widget?
The label.
final
maxHeight double
The menu's max height, in logical pixels. Defaults to infinity.
final
The point on the menu (floating content) that connects with the tile at the tile's anchor.
final
Whether the barrier semantics are included in the semantics tree. Defaults to true.
final
The popover's barrier label used by accessibility frameworks.
final
An optional focus node to use as the focus node for this widget.
final
An optional group ID that groups TapRegions together so that they operate as one region. If a tap occurs outside of all group members, then group members that are shown will be hidden.
final
The region that can be tapped to hide the popover.
final
Additional translation to apply to the popover's position.
final
Handler called when the focus changes.
final
A callback that is called when the popover is hidden by tapping outside of it.
final
The callback used to shift a popover when it overflows out of the viewport.
final
The spacing between the popover and child anchors.
final
Controls the transfer of focus beyond the first and the last items in a popover. Defaults to TraversalEdgeBehavior.closedLoop.
final
onReset VoidCallback?
An optional method to call when the form field is reset via FormFieldState.reset.
final
onSaved FormFieldSetter<Set<T>>?
An optional method to call with the final value when the form is saved via FormState.save.
final
physics ScrollPhysics
The scroll physics of the group. Defaults to ClampingScrollPhysics.
final
popoverControl FPopoverControl
The control that manages the popover visibility.
final
prefix Widget?
The prefix.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollController ScrollController?
The scroll controller used to control the position to which this menu is scrolled.
final
selectControl FMultiValueControl<T>?
The control that manages the selected values.
final
semanticsLabel String?
The menu's semantic label used by accessibility frameworks.
final
shortcuts Map<ShortcutActivator, Intent>?
The shortcuts. Defaults to calling ActivateIntent.
final
style FSelectMenuTileStyle Function(FSelectMenuTileStyle style)?
The style.
final
subtitle Widget?
The subtitle.
final
suffix Widget?
The suffix. Defaults to Icon(FIcons.chevronsUpDown).
final
tileAnchor AlignmentGeometry
The point on the tile that connects with the menu at the menu's anchor.
final
title Widget
The title.
final
validator FormFieldValidator<Set<T>>?
An optional method that validates an input. Returns an error string to display if the input is invalid, or null otherwise.
final

Methods

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