close
0

Remove padding from ListTile between leading and title

avatar
asked 13-09-2021

3 Answers


0

use Align and specify the Alignment.

ListTile _getActionMenu(String text, IconData icon, Function() onTap) {
  return new ListTile(
    leading: new Icon(icon),
    title: Align(
      child: new Text(text),
      alignment: Alignment(-1.2, 0),
    ),
    onTap: onTap,
  );
}
avatar
answered 13-09-2021

0

Use Transform.translate for consistent results.

ListTile(
  leading: Icon(icon),
  title: Transform.translate(
    offset: Offset(-16, 0),
    child: Text('Some text'),
  ),
);
avatar
answered 13-09-2021

0

use the minLeadingWidth on your ListTile. The default value is 40, so you can use a lower value to make your leading and title come closer.

ListTile(
  leading : Icon(Icons.settings),
  title : Text("Settings"),
  minLeadingWidth : 10,
);
avatar
answered 13-09-2021