Reputation: 1247
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.
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
Reputation: 1559
you can use a sizedbox with size as per your icon size for leading widget
Upvotes: 2