CheckboxGroupFieldState<T> constructor

CheckboxGroupFieldState<T>(
  1. List<CheckboxFieldState<T>> checkboxes, {
  2. required String label,
  3. String? error,
  4. Set<T>? value,
  5. List<ValidationRule<Set<T>>> rules = const [],
})

Creates a new instance of CheckboxGroupFieldState.

  • checkboxes: The list of individual checkbox field states within the group (required).
  • label: The label or name of the checkbox group form field (required).
  • value: The initial value of the checkbox group (default is null).
  • rules: The list of validation rules to apply to the checkbox group field (default is an empty list).

Implementation

CheckboxGroupFieldState(
  this.checkboxes, {
  required String label,
  String? error,
  Set<T>? value,
  List<ValidationRule<Set<T>>> rules = const [],
}) : super(value: value ?? <T>{}, label: label, error: error, rules: rules);