Ooto
Ooto

Reputation: 1247

Flutter: How can I make leading icon space?

I am new to Flutter and I am trying to create a pop up menu. How can I make leading icon space? When I set null, the layout will be like the picture below. And when I try to set IconButton's icon null, the menu can't be opened.

enter image description here

The code is like this.

       PopupMenuItem(
      child: ListTile(
        leading: null,
        title: Text(
          'Item3',
          style: TextStyle(
            color: Palette.whiteDarken1,
          ),
        ),
      ),
    ),
    PopupMenuItem(
      child: ListTile(
        leading: IconButton(
          icon: Icon(
            Icons.exit_to_app,
            color: Palette.whiteDarken1,
          ),
        ),
        title: Text(
          'Log In',
          style: TextStyle(
            color: Palette.whiteDarken1,
          ),
        ),
      ),
    ),

Upvotes: 0

Views: 438

Answers (1)

Vilsad P P
Vilsad P P

Reputation: 1559

you can use a sizedbox with size as per your icon size for leading widget

Upvotes: 2

Related Questions