checkboxSelected<T> method

bool checkboxSelected<T>(
  1. String fieldName,
  2. T value
)

Checks if a specific value is selected within a checkbox group.

This method checks if a specific checkbox value is selected.

  • Parameter fieldName The name of the checkbox group.
  • Parameter value The specific value to check for.
  • Returns: true if the checkbox with the given value is selected, otherwise false.
  • Throws: ArgumentError if the field doesn't exist.

Implementation

bool checkboxSelected<T>(String fieldName, T value) {
  return checkboxValues<T>(fieldName).contains(value);
}