Select Menu Tile
A tile that, when triggered, displays a list of options for the user to pick from.
For desktop, a select group is generally recommended over this.
Preview
CLI
To generate and customize this style:
dart run forui style create select-menu-tileUsage
FSelectMenuTile(...)
FSelectMenuTile<Value>(
title: const Text('Notifications'),
menu: [
FSelectTile(title: const Text('Option 1'), value: Value.option1),
],
selectControl: FMultiValueControl.managed(initial: {Value.option1}),
popoverControl: FPopoverControl.managed(),
scrollController: ScrollController(),
style: (style) => style.copyWith(...),
cacheExtent: 100,
maxHeight: 200,
dragStartBehavior: DragStartBehavior.start,
physics: const ClampingScrollPhysics(),
divider: FItemDivider.indented,
menuAnchor: Alignment.topRight,
tileAnchor: Alignment.bottomRight,
menuSpacing: FPortalSpacing.spacing(4),
menuOverflow: FPortalOverflow.flip,
menuOffset: Offset.zero,
menuHideRegion: FPopoverHideRegion.excludeChild,
menuOnTapHide: () {},
menuGroupId: 'group-id',
autoHide: true,
label: const Text('Sidebar'),
description: const Text('Select the items you want to display in the sidebar.'),
autofocus: false,
menuFocusNode: FocusScopeNode(),
menuOnFocusChange: (focused) {},
menuTraversalEdgeBehavior: TraversalEdgeBehavior.closedLoop,
menuBarrierSemanticsLabel: 'Dismiss',
menuBarrierSemanticsDismissible: true,
semanticsLabel: 'Notifications',
prefix: const Icon(FIcons.bell),
subtitle: const Text('subtitle'),
detailsBuilder: (context, values, child) => const Placeholder(),
details: const Text('All'),
suffix: const Icon(FIcons.chevronsUpDown),
shortcuts: {SingleActivator(LogicalKeyboardKey.enter): ActivateIntent()},
actions: {ActivateIntent: CallbackAction<ActivateIntent>(onInvoke: (_) {})},
errorBuilder: (context, error) => Text(error),
onSaved: (values) {},
onReset: () {},
validator: (values) => values?.isEmpty ?? true ? 'Select an item' : null,
forceErrorText: null,
enabled: true,
autovalidateMode: AutovalidateMode.disabled,
);FSelectMenuTile.builder(...)
FSelectMenuTile<int>.builder(
title: const Text('Applicable values'),
menuBuilder: (context, index) => FSelectTile(title: Text('Tile $index'), value: index),
count: 100,
selectControl: FMultiValueControl.managed(initial: {1}),
popoverControl: FPopoverControl.managed(),
scrollController: ScrollController(),
style: (style) => style.copyWith(...),
cacheExtent: 100,
maxHeight: 200,
dragStartBehavior: DragStartBehavior.start,
physics: const ClampingScrollPhysics(),
divider: FItemDivider.indented,
menuAnchor: Alignment.topRight,
tileAnchor: Alignment.bottomRight,
menuSpacing: FPortalSpacing.spacing(4),
menuOverflow: FPortalOverflow.flip,
menuOffset: Offset.zero,
menuHideRegion: FPopoverHideRegion.excludeChild,
menuOnTapHide: () {},
menuGroupId: 'group-id',
autoHide: true,
label: const Text('Settings'),
description: const Text('Select the items you want to display.'),
autofocus: false,
menuFocusNode: FocusScopeNode(),
menuOnFocusChange: (focused) {},
menuTraversalEdgeBehavior: TraversalEdgeBehavior.closedLoop,
menuBarrierSemanticsLabel: 'Dismiss',
menuBarrierSemanticsDismissible: true,
semanticsLabel: 'Values',
prefix: const Icon(FIcons.variable),
subtitle: const Text('subtitle'),
detailsBuilder: (context, values, child) => const Placeholder(),
details: const Text('Details'),
suffix: const Icon(FIcons.chevronsUpDown),
shortcuts: {SingleActivator(LogicalKeyboardKey.enter): ActivateIntent()},
actions: {ActivateIntent: CallbackAction<ActivateIntent>(onInvoke: (_) {})},
errorBuilder: (context, error) => Text(error),
onSaved: (values) {},
onReset: () {},
validator: (values) => values?.isEmpty ?? true ? 'Select an item' : null,
forceErrorText: null,
enabled: true,
autovalidateMode: AutovalidateMode.disabled,
);Examples
No Auto Hide
Preview
Scrollable
Preview
Lazy Scrollable
Preview
Form
Preview
Last updated on