buildCheckbox method

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

Implementation

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