checkboxGroupValue<T> method
Retrieves the first selected value of a checkbox group for a specified fieldName.
This method simplifies fetching the first selected checkbox value.
- Parameter
fieldNameThe name of the field to fetch. - Returns: The first selected value or
nullif none are selected. - Throws: ArgumentError if the field doesn't exist.
Implementation
T? checkboxGroupValue<T>(String fieldName) {
return checkboxValues<T>(fieldName).firstOrNull;
}