checkBoxFormEntry method
Widget
checkBoxFormEntry(
{ - String title = 'Checkbox',
- String subTitle = 'Select/Deselect',
- dynamic onChanged(
- bool?
)?,
- 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!();
}
},
),
);
}