-
Notifications
You must be signed in to change notification settings - Fork 30.2k
DropDownMenu secondary trailing widget (e.g. for clear action) #175847
Copy link
Copy link
Closed
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.r: solvedIssue is closed as solvedIssue is closed as solvedteam-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
Metadata
Metadata
Assignees
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.r: solvedIssue is closed as solvedIssue is closed as solvedteam-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
Type
Projects
Status
Done (PR merged)
Use case
If having a DropDownMenu it is currently only possible to replace the
trailingIcon, which is tied to an action.Internally a TextField with an IconButton is used to provide this dropdown action.
For convenience it should also be possible to define more trailing actions apart from the dropdown functionality. In comparison to a TextField, where this trailing icon is usually used as a
clearaction, it should also be possible for aDropDownMenuto define such an action via e.g.secondaryTrailing, which also could hold a list to define multiple trailing widgets, in front of the current dropdown tralingIcon.Proposal
How it currently is:
Proposal:
E.g. by providing a property called
secodaryTrailingAs reference: This is how its shown for a textfield with a clear icon:
https://m3.material.io/components/text-fields/overview
Workarounds
For me no workarounds are known. If replacing the
trailingIconwith aRowofIconButtons the Row would be still wrapped by the IconButton of the DropDownMenu Widget, which would result in a double wrapped IconButton, if providing a second one next to it.Alternative solutions
We could also have a
trailingparameter, which overrides all actions, but then it would be advisable to instead have atrailingBuilderto provide the dropdown action in the parameters, so one is able to customize the trailing widget without need of rebuilding the dropdown action.