checkBoxFormEntry method

Widget checkBoxFormEntry({
  1. String title = 'Checkbox',
  2. String subTitle = 'Select/Deselect',
  3. dynamic onChanged(
    1. bool?
    )?,
  4. bool defaultValue = false,
})

Implementation

Widget checkBoxFormEntry({
  String title = 'Checkbox',
  String subTitle = 'Select/Deselect',
  Function(bool?)? onChanged,
  bool defaultValue = false,
}) {
  return formEntry(
    title: title,
    subTitle: subTitle,
    inputWidget: CheckboxListTile(
      visualDensity: VisualDensity.compact,
      title: Text(title, style: Theme.of(context).textTheme.bodyLarge),
      value: defaultValue,
      enabled: isEdit,
      onChanged: (value) {
        onChanged!(value);
        widget.formKey.currentState!.save();
        if (widget.onModified != null) {
          widget.onModified!();
        }
      },
    ),
  );
}