FSelectMenuTile<T>.builder constructor

FSelectMenuTile<T>.builder({
  1. required Widget title,
  2. required FSelectTile<T>? menuBuilder(
    1. BuildContext context,
    2. int index
    ),
  3. int? count,
  4. FMultiValueControl<T>? selectControl,
  5. FPopoverControl popoverControl = const .managed(),
  6. ScrollController? scrollController,
  7. FSelectMenuTileStyle style(
    1. FSelectMenuTileStyle style
    )?,
  8. double? cacheExtent,
  9. double maxHeight = .infinity,
  10. DragStartBehavior dragStartBehavior = .start,
  11. ScrollPhysics physics = const ClampingScrollPhysics(),
  12. FItemDivider divider = .full,
  13. AlignmentGeometry menuAnchor = .topRight,
  14. AlignmentGeometry tileAnchor = .bottomRight,
  15. FPortalSpacing menuSpacing = const .spacing(4),
  16. FPortalOverflow menuOverflow = .flip,
  17. Offset menuOffset = .zero,
  18. FPopoverHideRegion menuHideRegion = .excludeChild,
  19. VoidCallback? menuOnTapHide,
  20. Object? menuGroupId,
  21. bool autoHide = true,
  22. Widget? label,
  23. Widget? description,
  24. bool autofocus = false,
  25. FocusScopeNode? menuFocusNode,
  26. ValueChanged<bool>? menuOnFocusChange,
  27. TraversalEdgeBehavior? menuTraversalEdgeBehavior,
  28. String? menuBarrierSemanticsLabel,
  29. bool menuBarrierSemanticsDismissible = true,
  30. String? semanticsLabel,
  31. Widget? prefix,
  32. Widget? subtitle,
  33. ValueWidgetBuilder<Set<T>> detailsBuilder = defaultSelectMenuTileBuilder,
  34. Widget? details,
  35. Widget? suffix,
  36. Map<ShortcutActivator, Intent>? shortcuts,
  37. Map<Type, Action<Intent>>? actions,
  38. Widget errorBuilder(
    1. BuildContext context,
    2. String message
    ) = FFormFieldProperties.defaultErrorBuilder,
  39. FormFieldSetter<Set<T>>? onSaved,
  40. VoidCallback? onReset,
  41. FormFieldValidator<Set<T>>? validator,
  42. String? forceErrorText,
  43. bool enabled = true,
  44. AutovalidateMode autovalidateMode = .disabled,
  45. Key? key,
})

Creates a FSelectMenuTile that lazily builds the menu.

The menuBuilder is called for each tile that should be built. The current level's FInheritedItemData is not visible to menuBuilder.

  • It may return null to signify the end of the group.
  • It may be called more than once for the same index.
  • It will be called only for indices <= count if count is given.

The count is the number of tiles to build. If null, menuBuilder will be called until it returns null.

Warning

May result in an infinite loop or run out of memory if:

  • Placed in a parent widget that does not constrain its size, i.e., Column.
  • count is null and menuBuilder always provides a zero-size widget, i.e., SizedBox(). If possible, provide tiles with non-zero size, return null from the builder, or set count to non-null.

Implementation

FSelectMenuTile.builder({
  required this.title,
  required FSelectTile<T>? Function(BuildContext context, int index) menuBuilder,
  int? count,
  this.selectControl,
  this.popoverControl = const .managed(),
  this.scrollController,
  this.style,
  this.cacheExtent,
  this.maxHeight = .infinity,
  this.dragStartBehavior = .start,
  this.physics = const ClampingScrollPhysics(),
  this.divider = .full,
  this.menuAnchor = .topRight,
  this.tileAnchor = .bottomRight,
  this.menuSpacing = const .spacing(4),
  this.menuOverflow = .flip,
  this.menuOffset = .zero,
  this.menuHideRegion = .excludeChild,
  this.menuOnTapHide,
  this.menuGroupId,
  this.autoHide = true,
  this.label,
  this.description,
  this.autofocus = false,
  this.menuFocusNode,
  this.menuOnFocusChange,
  this.menuTraversalEdgeBehavior,
  this.menuBarrierSemanticsLabel,
  this.menuBarrierSemanticsDismissible = true,
  this.semanticsLabel,
  this.prefix,
  this.subtitle,
  this.detailsBuilder = defaultSelectMenuTileBuilder,
  this.details,
  this.suffix,
  this.shortcuts,
  this.actions,
  this.errorBuilder = FFormFieldProperties.defaultErrorBuilder,
  this.onSaved,
  this.onReset,
  this.validator,
  this.forceErrorText,
  this.enabled = true,
  this.autovalidateMode = .disabled,
  super.key,
}) : _menu = null,
     _menuBuilder = menuBuilder,
     _count = count;