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
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:
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