Skip to content

Allow PopupMenuItem's width to be set to full width of the screen #64918

@misskter

Description

@misskter

When I use the showMenu method, I set the width of child to MediaQuery.of (context). size.width But it doesn't work. I see that it is implemented in the source code like this

const double _kMenuMaxWidth = 5.0 * _kMenuWidthStep ; 
const double _kMenuMinWidth = 2.0 * _kMenuWidthStep ; 
const double _kMenuVerticalPadding = 8.0 ; 
const double _kMenuWidthStep = 56.0 ; 
... 
...
_PopupMenu < T > 类扩展StatelessWidget {
    最终Widget= ConstrainedBox (
约束:const BoxConstraints (minWidth :_kMenuMinWidth ,maxWidth :_kMenuMaxWidth ,),... ...      
},

But I want it to be the maximum width of my screen

Metadata

Metadata

Assignees

Labels

c: proposalA detailed proposal for a change to Flutterf: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.r: fixedIssue is closed as already fixed in a newer version

Type

No type

Projects

Status

Done (PR merged)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions