import 'package:flutter/material.dart'; class MyCheckbox extends StatelessWidget { final String title; final bool value; final ValueChanged? onChanged; final bool enabled = true; const MyCheckbox({super.key, required this.title, required this.value, this.onChanged}); @override Widget build(BuildContext context) { return ConstrainedBox( constraints: const BoxConstraints(minHeight: 32), child: ListTile( dense: true, title: Text(title, style: const TextStyle(fontSize: 12)), contentPadding: EdgeInsets.zero, leading: Transform.scale( scale: 0.75, child: Checkbox( value: value, onChanged: enabled ? onChanged : null, activeColor: enabled ? null : Colors.grey, ), ), onTap: enabled && onChanged != null ? () => onChanged!(!value) : null, ), ); } }