从CheckboxListTile删除内部填充

时间:2020-08-12 06:02:19

标签: flutter

如何从CheckboxListTile删除内部填充? 我试过了: contentPadding:EdgeInsets.all(0), 密集:正确,

两者都有帮助,但它们不会删除复选框和文本之间的内部填充

enter image description here

这是我的代码:

CheckboxListTile(
                  title: Text('Remember me'),
                  controlAffinity: ListTileControlAffinity.leading,
                  contentPadding: EdgeInsets.all(0),
                  dense: true,
                  value: isPrefered,
                  onChanged: (bool value) => setState(() => isPrefered = value),
                ),
              )

1 个答案:

答案 0 :(得分:0)

ListTileTheme(
contentPadding: EdgeInsets.all(0),
child: CheckboxListTile(
secondary: const Icon(Icons.drive_eta),
title: Text("Your message"),
onChanged: (bool value) {},
value: true,
),
),

尝试一下