[Breaking Change] PopupMenuItem height defines the item's minimum height

123 views
Skip to first unread message

Hans Muller

unread,
Sep 10, 2019, 5:09:54 PM9/10/19
to flutter-...@googlegroups.com
I'm proposing to change the default value of the PopupMenuItem height parameter to null, and to interpret it as a minimum rather than a fixed value. If height is null, then the minimum value will be 48, the same as its original fixed value. Menu items with a child whose intrinsic size is bigger than the minimum will now be big enough to contain their child.

This change is described in detail here: https://github.com/flutter/flutter/pull/40179. Most apps are likely to be unaffected.

For apps that specified fixed height menu items, where the height was greater than 48 (the minimum height for a11y), and not the same as the item's intrinsic height, the menu item's child can be enclosed in a SizedBox:

// original code
PopupMenuItem<String>(
  height: 50,
  child: Text('Item'),
)

// updated code
PopupMenuItem<String>(
  child: SizedBox(
    height: 50,
    child: Text('Item'),
  ),
)

If you believe that this change will cause difficulties or need help in porting existing code, you can contact me directly.
Reply all
Reply to author
Forward
0 new messages