onValueChange method

void onValueChange(
  1. String? id,
  2. bool value,
  3. TDCheckboxGroupState? groupState
)

选中状态的变化

Implementation

void onValueChange(
  String? id,
  bool value,
  TDCheckboxGroupState? groupState,
) {
  if (!widget.enable) {
    return;
  }
  setState(() {
    checked = value;
    if (groupState != null && id != null) {
      groupState.toggle(id, checked);
    }
    widget.onCheckBoxChanged?.call(checked);
  });
}