简体   繁体   English

从 CheckboxListTile 中删除内部填充

[英]Remove inner padding from CheckboxListTile

How can I remove the inner padding from a CheckboxListTile ?如何从CheckboxListTile中删除内部填充? I tried: contentPadding: EdgeInsets.all(0), dense: true,我试过: contentPadding: EdgeInsets.all(0), dense: true,

and they both help, but they don't remove the inner padding between the checkbox and the text他们都有帮助,但他们不会删除复选框和文本之间的内部填充

在此处输入图像描述

Here's my code:这是我的代码:

CheckboxListTile(
                  title: Text('Remember me'),
                  controlAffinity: ListTileControlAffinity.leading,
                  contentPadding: EdgeInsets.all(0),
                  dense: true,
                  value: isPrefered,
                  onChanged: (bool value) => setState(() => isPrefered = value),
                ),
              )
ListTileTheme(
    contentPadding: EdgeInsets.all(0),
    child: CheckboxListTile(
        secondary: const Icon(Icons.drive_eta),
        title: Text("Your message"),
        onChanged: (bool value) {},
        value: true,
    ),
),

Try this尝试这个

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM