onItemCheckedChange method

List<T> onItemCheckedChange(
  1. List<T> selectedValues,
  2. T itemValue,
  3. bool checked
)

Implementation

List<T> onItemCheckedChange(
    List<T> selectedValues, T itemValue, bool checked) {
  if (checked) {
    selectedValues.add(itemValue);
  } else {
    selectedValues.remove(itemValue);
  }
  return selectedValues;
}