0

How would I remove the padding that's present here in the SizedBox widget that wraps each button:

enter image description here

I tried, as you can see in the code, to set the padding of the container that is wrapped BY the SizedBox equal to 0 but it didn't work. I basically just want to make each SizedBox smaller so that the content inside is closer to each other. I was wondering if there was any workaround for doing so.

Container( // container holding the main setting buttons
  child: Padding(
    padding: const EdgeInsets.only(top: 20, bottom: 0, left: 30, right: 30),
    child: Container(
      width: double.infinity,
      decoration: BoxDecoration(
        border: Border.all(color: Colors.black, width: 2.5),
        borderRadius: BorderRadius.circular(25)
      ),
      padding: const EdgeInsets.only(left: 7, top: 7, right: 10, bottom: 8),
      child: Column(
        children: [
          Material(color: Colors.transparent,
            child: SizedBox(width: 250.0, child: Container(padding: EdgeInsets.zero, child: ListTile(onTap:(){}, title:Text("Privacy"),leading: Icon(Icons.add_circle_outline)))),
          ),
          Material(
            child: SizedBox(width: 250.0, child: ListTile(onTap:(){},title:Text("Terms of Service"),leading: Icon(Icons.add_circle_outline))),
          ),
          Material(
            child: SizedBox(width: 250.0, child: ListTile(onTap:(){},title:Text("Community Rules"),leading: Icon(Icons.add_circle_outline))),
          ),
        ]
      ),
    ),
  ),
),
Soccerball123
  • 741
  • 5
  • 17

1 Answers1

0

The problem doesn't relates to your SizedBox, it belongs to ListTile.

About ListTile, you can check out How to Remove space at top and bottom ListTile flutter? and Remove padding from ListTile between leading and title.

Icon(Icons.abcxyz) may also contain a little margin because of their design, you should also notice.

Nguyen family
  • 749
  • 2
  • 12