CustomCheckboxFormField constructor
- {Widget? title,
- FormFieldSetter<
bool> ? onSaved, - FormFieldValidator<
bool> ? validator, - bool initialValue = false,
- bool autovalidate = false}
Implementation
CustomCheckboxFormField(
{Widget? title,
FormFieldSetter<bool>? onSaved,
FormFieldValidator<bool>? validator,
bool initialValue = false,
bool autovalidate = false})
: super(
onSaved: onSaved,
validator: validator,
initialValue: initialValue,
autovalidateMode: AutovalidateMode.disabled,
builder: (FormFieldState<bool> state) {
return Builder(
builder: (BuildContext context) => Column(children: [
Row(
mainAxisSize: MainAxisSize.max,
children: [
Checkbox(
value: state.value,
onChanged: state.didChange,
shape: CircleBorder(),
side: BorderSide(
color: Theme.of(context).primaryColor,
),
activeColor: Theme.of(context).primaryColor,
),
// CircularCheckBox(
// value: state.value,
// onChanged: state.didChange,
// inactiveColor: Theme.of(context).primaryColor,
// activeColor: Theme.of(context).primaryColor,
// ),
SizedBox(width: 3),
Expanded(child: title!),
],
),
state.hasError
? Text(state.errorText!,
style: textStyleFrom(
Theme.of(context)
.primaryTextTheme
.bodyText1,
color: Theme.of(context).errorColor,
fontSize: 12))
: Container(),
]));
});