FormBuilderCheckboxGroup<T> constructor
FormBuilderCheckboxGroup<T> ({
- Key? key,
- required String name,
- VisualDensity? visualDensity,
- FormFieldValidator<
List< ? validator,T> > - List<
T> ? initialValue, - InputDecoration decoration = const InputDecoration(),
- ValueChanged<
List< ? onChanged,T> ?> - ValueTransformer<
List< ? valueTransformer,T> ?> - bool enabled = true,
- FormFieldSetter<
List< ? onSaved,T> > - AutovalidateMode? autovalidateMode = AutovalidateMode.disabled,
- VoidCallback? onReset,
- FocusNode? focusNode,
- String? restorationId,
- required List<
FormBuilderFieldOption< options,T> > - Color? activeColor,
- Color? checkColor,
- Color? focusColor,
- Color? hoverColor,
- List<
T> ? disabled, - MaterialTapTargetSize? materialTapTargetSize,
- bool tristate = false,
- Axis wrapDirection = Axis.horizontal,
- WrapAlignment wrapAlignment = WrapAlignment.start,
- double wrapSpacing = 0.0,
- WrapAlignment wrapRunAlignment = WrapAlignment.start,
- double wrapRunSpacing = 0.0,
- WrapCrossAlignment wrapCrossAxisAlignment = WrapCrossAlignment.start,
- TextDirection? wrapTextDirection,
- VerticalDirection wrapVerticalDirection = VerticalDirection.down,
- Widget? separator,
- ControlAffinity controlAffinity = ControlAffinity.leading,
- OptionsOrientation orientation = OptionsOrientation.wrap,
- BoxDecoration? itemDecoration,
Creates a list of Checkboxes for selecting multiple options
Implementation
FormBuilderCheckboxGroup({
super.key,
required super.name,
this.visualDensity,
super.validator,
super.initialValue,
super.decoration,
super.onChanged,
super.valueTransformer,
super.enabled,
super.onSaved,
super.autovalidateMode = AutovalidateMode.disabled,
super.onReset,
super.focusNode,
super.restorationId,
required this.options,
this.activeColor,
this.checkColor,
this.focusColor,
this.hoverColor,
this.disabled,
this.materialTapTargetSize,
this.tristate = false,
this.wrapDirection = Axis.horizontal,
this.wrapAlignment = WrapAlignment.start,
this.wrapSpacing = 0.0,
this.wrapRunAlignment = WrapAlignment.start,
this.wrapRunSpacing = 0.0,
this.wrapCrossAxisAlignment = WrapCrossAlignment.start,
this.wrapTextDirection,
this.wrapVerticalDirection = VerticalDirection.down,
this.separator,
this.controlAffinity = ControlAffinity.leading,
this.orientation = OptionsOrientation.wrap,
this.itemDecoration,
}) : super(
builder: (FormFieldState<List<T>?> field) {
final state = field as _FormBuilderCheckboxGroupState<T>;
return InputDecorator(
decoration: state.decoration,
child: GroupedCheckbox<T>(
orientation: orientation,
value: state.value,
options: options,
onChanged: (val) {
field.didChange(val);
},
disabled: state.enabled
? disabled
: options.map((e) => e.value).toList(),
activeColor: activeColor,
visualDensity: visualDensity,
focusColor: focusColor,
checkColor: checkColor,
materialTapTargetSize: materialTapTargetSize,
hoverColor: hoverColor,
tristate: tristate,
wrapAlignment: wrapAlignment,
wrapCrossAxisAlignment: wrapCrossAxisAlignment,
wrapDirection: wrapDirection,
wrapRunAlignment: wrapRunAlignment,
wrapRunSpacing: wrapRunSpacing,
wrapSpacing: wrapSpacing,
wrapTextDirection: wrapTextDirection,
wrapVerticalDirection: wrapVerticalDirection,
separator: separator,
controlAffinity: controlAffinity,
itemDecoration: itemDecoration,
),
);
},
);