postCheckBox function

Widget postCheckBox({
  1. required String checkBoxText,
  2. required void onPressed()?,
  3. required bool value,
})

Implementation

Widget postCheckBox({
  required String checkBoxText,
  required void Function() ?onPressed,
  required bool value,
}){
  return MaterialButton(
    onPressed: onPressed,
    child: Row(
      mainAxisAlignment: MainAxisAlignment.spaceBetween,
      children: [
        Text(
          checkBoxText,
          style: defaultTextStyle(),
        ),
        Checkbox(
          value: value,
          onChanged: (value){
            if(onPressed!=null){
              onPressed();
            }
          },
        ),
      ],
    ),
  );
}