buildSwitch method

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

Implementation

Widget buildSwitch(
  BuildContext context, {
  Widget? leading,
  Widget? trailing,
}) =>
    Switch(
      leading: leading,
      trailing: trailing,
      value: value ?? false,
      onChanged: (v) =>
          onChanged != null ? onChanged!(v == CheckboxState.checked) : null,
    );