FSelectTileGroup<T> constructor

FSelectTileGroup<T>({
  1. required FSelectTileGroupController<T> selectController,
  2. required List<FSelectTile<T>> children,
  3. ScrollController? scrollController,
  4. FTileGroupStyle? style,
  5. double? cacheExtent,
  6. double maxHeight = double.infinity,
  7. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  8. ScrollPhysics physics = const ClampingScrollPhysics(),
  9. FTileDivider divider = FTileDivider.indented,
  10. Widget? label,
  11. Widget? description,
  12. String? semanticsLabel,
  13. ValueChanged<Set<T>>? onChange,
  14. ValueChanged<(T, bool)>? onSelect,
  15. Widget errorBuilder(
    1. BuildContext,
    2. String
    ) = FFormFieldProperties.defaultErrorBuilder,
  16. FormFieldSetter<Set<T>>? onSaved,
  17. FormFieldValidator<Set<T>>? validator,
  18. String? forceErrorText,
  19. bool enabled = true,
  20. AutovalidateMode? autovalidateMode,
  21. Key? key,
})

Creates a FSelectTileGroup.

Implementation

FSelectTileGroup({
  required this.selectController,
  required List<FSelectTile<T>> children,
  this.scrollController,
  this.style,
  this.cacheExtent,
  this.maxHeight = double.infinity,
  this.dragStartBehavior = DragStartBehavior.start,
  this.physics = const ClampingScrollPhysics(),
  this.divider = FTileDivider.indented,
  this.label,
  this.description,
  this.semanticsLabel,
  this.onChange,
  this.onSelect,
  Widget Function(BuildContext, String) errorBuilder = FFormFieldProperties.defaultErrorBuilder,
  super.onSaved,
  super.validator,
  super.forceErrorText,
  super.enabled = true,
  super.autovalidateMode,
  super.key,
}) : super(
       initialValue: selectController.value,
       builder: (field) {
         final state = field as _State;
         return FTileGroup(
           scrollController: scrollController,
           style: style ?? state.context.theme.tileGroupStyle,
           cacheExtent: cacheExtent,
           maxHeight: maxHeight,
           dragStartBehavior: dragStartBehavior,
           physics: physics,
           divider: divider,
           label: label,
           enabled: enabled,
           description: description,
           error: switch (state.errorText) {
             _ when !enabled => null,
             final text? => errorBuilder(state.context, text),
             null => null,
           },
           semanticsLabel: semanticsLabel,
           children: [
             for (final child in children)
               FSelectTileData<T>(
                 controller: selectController,
                 selected: selectController.contains(child.value),
                 child: child,
               ),
           ],
         );
       },
     );