FSelectMenuTile<T>.fromMap constructor

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

Creates a FSelectMenuTile with the given menu.

Contract

Each key in menu must map to a unique value. Having multiple keys map to the same value will result in undefined behavior.

Implementation

factory FSelectMenuTile.fromMap(
  Map<String, T> menu, {
  required Text title,
  FMultiValueControl<T>? selectControl,
  FPopoverControl popoverControl = const .managed(),
  ScrollController? scrollController,
  FSelectMenuTileStyle Function(FSelectMenuTileStyle style)? 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 Function(BuildContext context, String message) errorBuilder = FFormFieldProperties.defaultErrorBuilder,
  FormFieldSetter<Set<T>>? onSaved,
  VoidCallback? onReset,
  FormFieldValidator<Set<T>>? validator,
  String? forceErrorText,
  bool enabled = true,
  AutovalidateMode autovalidateMode = .disabled,
  Key? key,
}) => .new(
  title: title,
  menu: [for (final MapEntry(:key, :value) in menu.entries) FSelectTile<T>(title: Text(key), value: value)],
  selectControl: selectControl,
  popoverControl: popoverControl,
  scrollController: scrollController,
  style: style,
  cacheExtent: cacheExtent,
  maxHeight: maxHeight,
  dragStartBehavior: dragStartBehavior,
  physics: physics,
  divider: divider,
  menuAnchor: menuAnchor,
  tileAnchor: tileAnchor,
  menuSpacing: menuSpacing,
  menuOverflow: menuOverflow,
  menuOffset: menuOffset,
  menuHideRegion: menuHideRegion,
  menuOnTapHide: menuOnTapHide,
  menuGroupId: menuGroupId,
  autoHide: autoHide,
  label: label,
  description: description,
  autofocus: autofocus,
  menuFocusNode: menuFocusNode,
  menuOnFocusChange: menuOnFocusChange,
  menuTraversalEdgeBehavior: menuTraversalEdgeBehavior,
  menuBarrierSemanticsLabel: menuBarrierSemanticsLabel,
  menuBarrierSemanticsDismissible: menuBarrierSemanticsDismissible,
  semanticsLabel: semanticsLabel,
  prefix: prefix,
  subtitle: subtitle,
  detailsBuilder: detailsBuilder,
  details: details,
  suffix: suffix,
  shortcuts: shortcuts,
  actions: actions,
  errorBuilder: errorBuilder,
  onSaved: onSaved,
  onReset: onReset,
  validator: validator,
  forceErrorText: forceErrorText,
  enabled: enabled,
  autovalidateMode: autovalidateMode,
  key: key,
);