buildCheckbox method

Widget buildCheckbox(
  1. BuildContext context, {
  2. Widget? leading,
  3. Widget? trailing,
})

Implementation

Widget buildCheckbox(
  BuildContext context, {
  Widget? leading,
  Widget? trailing,
}) =>
    Checkbox(
      leading: leading,
      tristate: tristate,
      trailing: trailing,
      state: value == false
          ? CheckboxState.unchecked
          : value == null
              ? CheckboxState.indeterminate
              : CheckboxState.checked,
      onChanged: (v) => onChanged != null
          ? onChanged!(v == CheckboxState.checked
              ? true
              : v == CheckboxState.indeterminate
                  ? null
                  : false)
          : null,
    );