Reputation: 2989
I am adding a check box and list title to my app. However, these item are not left align with the other widgets. How can I align it with the other widgets
here is a picture
Upvotes: 42
Views: 28788
Reputation: 71
Maybe a bit late but CheckboxListTile
class has a contentPadding
property which is set to horizontal 16 padding by default.
Adding this line made the trick for me:
contentPadding: EdgeInsets.symmetric(horizontal: 0)
Upvotes: 7
Reputation: 11669
You can use CheckboxListTile
widget which has property called controlAffinity
. Setting it to leading
will make the checkbox left aligned. Below is sample working code:
CheckboxListTile(
controlAffinity: ListTileControlAffinity.leading,
title: Text('I agree to the Terms and Conditions'),
value: monVal,
onChanged: (bool value) {
setState(() {
monVal = value;
});
},
)
And the output is:
Upvotes: 127