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 clear action, it should also be possible for a DropDownMenu to 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 secodaryTrailing
As 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 trailingIcon with a Row of IconButtons 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 trailing parameter, which overrides all actions, but then it would be advisable to instead have a trailingBuilder to provide the dropdown action in the parameters, so one is able to customize the trailing widget without need of rebuilding the dropdown action.
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.