FSelectTileGroup<T> constructor
FSelectTileGroup<T> ({
- required FSelectTileGroupController<
T> selectController, - required List<
FSelectTile< children,T> > - ScrollController? scrollController,
- FTileGroupStyle? style,
- double? cacheExtent,
- double maxHeight = double.infinity,
- DragStartBehavior dragStartBehavior = DragStartBehavior.start,
- ScrollPhysics physics = const ClampingScrollPhysics(),
- FTileDivider divider = FTileDivider.indented,
- Widget? label,
- Widget? description,
- String? semanticsLabel,
- ValueChanged<
Set< ? onChange,T> > - ValueChanged<
(T, bool)> ? onSelect, - Widget errorBuilder() = FFormFieldProperties.defaultErrorBuilder,
- FormFieldSetter<
Set< ? onSaved,T> > - FormFieldValidator<
Set< ? validator,T> > - String? forceErrorText,
- bool enabled = true,
- AutovalidateMode? autovalidateMode,
- 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,
),
],
);
},
);