I'm looking to remove this padding around my row of CheckboxListTiles, but haven't found any information on how to do this without making my own version of a checkbox.
Is there any way to (using the CheckboxListTile):
UPDATE: There is no need to use ListTitleTheme
anymore. contentPadding
is now one of CheckboxListTile
's properties. We can now remove the default padding
like this:
CheckboxListTile(
contentPadding: EdgeInsets.zero,
)
Try using the following code:
ListTileTheme(
contentPadding: EdgeInsets.all(0),
child: CheckboxListTile(
secondary: const Icon(Icons.drive_eta),
title: Text("Your message"),
onChanged: (bool value) {},
value: true,
),
),
Add
ListTileTheme(
contentPadding: EdgeInsets.all(0),
then
ListTileTheme(
contentPadding: EdgeInsets.all(0),
child: CheckboxListTile(
activeColor: CustomColors.purple,
title: Text("title text"),
value: true,
onChanged: (newValue) {},
controlAffinity:
ListTileControlAffinity.leading, // <-- leading Checkbox
),
),
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With