Skip to content

Custom Padding in PopupMenuButton #57110

Description

@NidheeshMt

Not able to configure padding in PopupMenuButton. It is seems like it using the default values for vertical and horizontal paddings,

const double _kMenuCloseIntervalEnd = 2.0 / 3.0;
const double _kMenuHorizontalPadding = 16.0;
const double _kMenuDividerHeight = 16.0;
const double _kMenuMaxWidth = 5.0 * _kMenuWidthStep;
const double _kMenuMinWidth = 2.0 * _kMenuWidthStep;
const double _kMenuVerticalPadding = 8.0;
const double _kMenuWidthStep = 56.0;
const double _kMenuScreenPadding = 8.0;

Flutter 1.17.0 • channel beta • https://github.com/flutter/flutter.git
Framework • revision e6b34c2 (11 days ago) • 2020-05-02 11:39:18 -0700
Engine • revision 540786dd51
Tools • Dart 2.8.1

Activity

  1. added
    p: material_uimaterial_ui package in flutter/packages
    frameworkflutter/packages/flutter repository. See also f: labels.
    c: proposalA detailed proposal for a change to Flutter
    on May 13, 2020
  2. changed the title [-]Padding in PopupMenuButton[/-] [+]Custom Padding in PopupMenuButton[/+] on Jun 17, 2020
  3. LucaIaconelli commented on Aug 1, 2020

    @LucaIaconelli

    It would be fantastic to be able to change this value (_kMenuHorizontalPadding) so that you have the option to remove the padding.

  4. xJon commented on Oct 19, 2020

    @xJon

    Would be a useful feature.

  5. rydmike commented on Feb 22, 2021

    @rydmike
    Contributor

    Plus one for this issue. 👍🏻

    I just searched for how to remove and change these as well and landed here. Particularly I wanted to get rid of of the top and bottom padding on the popup menu.

    This use case example with a long press on a widget context menu, with rounded corners and slightly transparent background, eg as a cut / copy / paste context menu. Would have looked much nicer and compacter without the extra padding on top and bottom. Being able to remove them would have enabled having the padding just a part of the the item height, so when selecting top and bottom items, the highlighte selection and splash would have included the rounded shape border, but nope, no can do, not with this widget.

    context_menu

    Parameters like this should be part of PopupMenuThemeData and as properties in the Widget.
    Material still does not always want to work with you, when you want a slightly different design. I know, back to making totally custom widgets or forking this one, just don't always have time for it, this will have to do for now, the look is acceptable for now for my use case, but it could have been even prettier.

    Pity to see an issue like these open for this long, it was reported in May 2020.

    cc: @HansMuller @mariamhas

  6. added
    a: annoyanceRepeatedly frustrating issues with non-experimental functionality
    customer: crowdAffects or could affect many people, though not necessarily a specific customer.
    on Mar 2, 2021
  7. Moluram commented on May 4, 2021

    @Moluram
    Contributor

    @pedromassangocode Hello! Can I take this issue?

  8. pedromassangocode commented on May 5, 2021

    @pedromassangocode

    Hi @Moluram of course :)

    I will assign it to you.

  9. added
    r: fixedIssue is closed as already fixed in a newer version
    on Jan 17, 2022
  10. github-actions commented on Jan 31, 2022

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  11. locked as resolved and limited conversation to collaborators on Jan 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

a: annoyanceRepeatedly frustrating issues with non-experimental functionalitya: qualityA truly polished experiencec: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Fluttercustomer: crowdAffects or could affect many people, though not necessarily a specific customer.frameworkflutter/packages/flutter repository. See also f: labels.p: material_uimaterial_ui package in flutter/packagesr: fixedIssue is closed as already fixed in a newer version

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions