FSelectMenuTile<T>.fromMap constructor

FSelectMenuTile<T>.fromMap(
  1. Map<String, T> menu, {
  2. required Text title,
  3. FSelectMenuTileController<T>? selectController,
  4. FPopoverController? popoverController,
  5. ScrollController? scrollController,
  6. FSelectMenuTileStyle style(
    1. FSelectMenuTileStyle
    )?,
  7. double? cacheExtent,
  8. double maxHeight = double.infinity,
  9. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  10. ScrollPhysics physics = const ClampingScrollPhysics(),
  11. FItemDivider divider = FItemDivider.full,
  12. AlignmentGeometry menuAnchor = Alignment.topRight,
  13. AlignmentGeometry tileAnchor = Alignment.bottomRight,
  14. FPortalSpacing spacing = const FPortalSpacing(4),
  15. Offset shift(
    1. Size,
    2. FPortalChildBox,
    3. FPortalBox
    ) = FPortalShift.flip,
  16. Offset offset = Offset.zero,
  17. FPopoverHideRegion hideRegion = FPopoverHideRegion.excludeChild,
  18. VoidCallback? onTapHide,
  19. bool autoHide = true,
  20. Widget? label,
  21. Widget? description,
  22. bool autofocus = false,
  23. FocusScopeNode? focusNode,
  24. ValueChanged<bool>? onFocusChange,
  25. TraversalEdgeBehavior? traversalEdgeBehavior,
  26. String? barrierSemanticsLabel,
  27. bool barrierSemanticsDismissible = true,
  28. String? semanticsLabel,
  29. Widget? prefix,
  30. Widget? subtitle,
  31. ValueWidgetBuilder<Set<T>> detailsBuilder = _builder,
  32. Widget? details,
  33. Widget? suffix,
  34. Map<ShortcutActivator, Intent>? shortcuts,
  35. Map<Type, Action<Intent>>? actions,
  36. ValueChanged<Set<T>>? onChange,
  37. ValueChanged<(T, bool)>? onSelect,
  38. Widget errorBuilder(
    1. BuildContext,
    2. String
    ) = FFormFieldProperties.defaultErrorBuilder,
  39. T? initialValue,
  40. FormFieldSetter<Set<T>>? onSaved,
  41. FormFieldValidator<Set<T>>? validator,
  42. String? forceErrorText,
  43. bool enabled = true,
  44. AutovalidateMode? autovalidateMode,
  45. String? restorationId,
  46. 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.

Throws AssertionError if both selectController and initialValue are provided.

Implementation

factory FSelectMenuTile.fromMap(
  Map<String, T> menu, {
  required Text title,
  FSelectMenuTileController<T>? selectController,
  FPopoverController? popoverController,
  ScrollController? scrollController,
  FSelectMenuTileStyle Function(FSelectMenuTileStyle)? style,
  double? cacheExtent,
  double maxHeight = double.infinity,
  DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  ScrollPhysics physics = const ClampingScrollPhysics(),
  FItemDivider divider = FItemDivider.full,
  AlignmentGeometry menuAnchor = Alignment.topRight,
  AlignmentGeometry tileAnchor = Alignment.bottomRight,
  FPortalSpacing spacing = const FPortalSpacing(4),
  Offset Function(Size, FPortalChildBox, FPortalBox) shift = FPortalShift.flip,
  Offset offset = Offset.zero,
  FPopoverHideRegion hideRegion = FPopoverHideRegion.excludeChild,
  VoidCallback? onTapHide,
  bool autoHide = true,
  Widget? label,
  Widget? description,
  bool autofocus = false,
  FocusScopeNode? focusNode,
  ValueChanged<bool>? onFocusChange,
  TraversalEdgeBehavior? traversalEdgeBehavior,
  String? barrierSemanticsLabel,
  bool barrierSemanticsDismissible = true,
  String? semanticsLabel,
  Widget? prefix,
  Widget? subtitle,
  ValueWidgetBuilder<Set<T>> detailsBuilder = _builder,
  Widget? details,
  Widget? suffix,
  Map<ShortcutActivator, Intent>? shortcuts,
  Map<Type, Action<Intent>>? actions,
  ValueChanged<Set<T>>? onChange,
  ValueChanged<(T, bool)>? onSelect,
  Widget Function(BuildContext, String) errorBuilder = FFormFieldProperties.defaultErrorBuilder,
  T? initialValue,
  FormFieldSetter<Set<T>>? onSaved,
  FormFieldValidator<Set<T>>? validator,
  String? forceErrorText,
  bool enabled = true,
  AutovalidateMode? autovalidateMode,
  String? restorationId,
  Key? key,
}) => FSelectMenuTile<T>(
  title: title,
  menu: [for (final MapEntry(:key, :value) in menu.entries) FSelectTile<T>(title: Text(key), value: value)],
  selectController: selectController,
  popoverController: popoverController,
  scrollController: scrollController,
  style: style,
  cacheExtent: cacheExtent,
  maxHeight: maxHeight,
  dragStartBehavior: dragStartBehavior,
  physics: physics,
  divider: divider,
  menuAnchor: menuAnchor,
  tileAnchor: tileAnchor,
  spacing: spacing,
  shift: shift,
  offset: offset,
  hideRegion: hideRegion,
  onTapHide: onTapHide,
  autoHide: autoHide,
  label: label,
  description: description,
  autofocus: autofocus,
  focusNode: focusNode,
  onFocusChange: onFocusChange,
  traversalEdgeBehavior: traversalEdgeBehavior,
  barrierSemanticsLabel: barrierSemanticsLabel,
  barrierSemanticsDismissible: barrierSemanticsDismissible,
  semanticsLabel: semanticsLabel,
  prefix: prefix,
  subtitle: subtitle,
  detailsBuilder: detailsBuilder,
  details: details,
  suffix: suffix,
  shortcuts: shortcuts,
  actions: actions,
  onChange: onChange,
  onSelect: onSelect,
  errorBuilder: errorBuilder,
  initialValue: initialValue,
  onSaved: onSaved,
  validator: validator,
  forceErrorText: forceErrorText,
  enabled: enabled,
  autovalidateMode: autovalidateMode,
  restorationId: restorationId,
  key: key,
);