checkBox function

dynamic checkBox(
  1. bool checked,
  2. String text,
  3. dynamic onChange(
    1. bool?
    )?
)

Checkbox with text message

value of checkbox checked (true, false) text message follow by the checkbox onChange function onChange(value) to track the checkbox true false value

Implementation

checkBox(bool checked, String text, Function(bool?)? onChange) {
  return Row(
    children: [
      Padding(
        padding: const EdgeInsets.only(right: 4.0, top: 4.0, bottom: 4.0),
        child: SizedBox(
            width: 24,
            height: 24,
            child: Checkbox(value: checked, onChanged: onChange)),
      ),
      Expanded(child: Text("$text")),
    ],
  );
}