FSelectGroupItem<T>.checkbox constructor

FSelectGroupItem<T>.checkbox({
  1. required T value,
  2. FCheckboxSelectGroupStyle? style,
  3. Widget? label,
  4. Widget? description,
  5. String? semanticLabel,
  6. Widget? error,
  7. bool enabled = true,
  8. bool autofocus = false,
  9. FocusNode? focusNode,
  10. ValueChanged<bool>? onFocusChange,
  11. Key? key,
})

Creates a FSelectGroupItem that wraps a FCheckbox.

Implementation

factory FSelectGroupItem.checkbox({
  required T value,
  FCheckboxSelectGroupStyle? style,
  Widget? label,
  Widget? description,
  String? semanticLabel,
  Widget? error,
  bool enabled = true,
  bool autofocus = false,
  FocusNode? focusNode,
  ValueChanged<bool>? onFocusChange,
  Key? key,
}) =>
    FSelectGroupItem(
      value: value,
      builder: (context, onChange, selected) {
        final computedStyle = style ?? context.theme.selectGroupStyle.checkboxStyle;

        return Padding(
          padding: computedStyle.padding,
          child: FCheckbox(
            style: computedStyle,
            label: label,
            description: description,
            semanticLabel: semanticLabel,
            error: error,
            value: selected,
            onChange: (state) => onChange(value, state),
            enabled: enabled,
            autofocus: autofocus,
            focusNode: focusNode,
            onFocusChange: onFocusChange,
            key: key,
          ),
        );
      },
    );