-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)Accessibility, e.g. VoiceOver or TalkBack. (aka a11y)c: 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.team-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
Description
Use case
DropdownMenu icons
Actually, both icons (leading and trailing) are optional but we can only "hide" leadingIcon by not passing it as parameter, if not passed, there will not be a default leadingIcon.
For trailingIcon, there is a default icon and the only way to hide it (maybe not the best) is to pass SizedBox.shrink() as trailingIcon parameter.
The problem is that we can't totally customise DropdownMenu icons because even without giving parameters, there is a Container or something that Talkback is focusing and accessibility is not 100% compliant.
Proposal
Add options to DropdownMenu constructor to hide trailing/leading icons.
It may be not the correct way and I agree that we have to find a solution that will not break the current DropdownMenu's contract
final bool hideLeadingIcon;
final bool hideTrailingIcon;
const DropdownMenu({
....
this.hideLeadingIcon = false
this.hideTrailingIcon = false
})
final Widget? leadingButton = hideLeadingIcon ? null : Padding(
....
);
final Widget? trailingButton = hideTrailingIcon ? null : Padding(
....
);
final Widget body =
widget.expandedInsets != null
? textField
: _DropdownMenuBody(
....
children: <Widget>[
....
trailingButton,
leadingButton,
].nonNulls,
);
mohamedamara
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)Accessibility, e.g. VoiceOver or TalkBack. (aka a11y)c: 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.team-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team