-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Added DropdownMenuEntry.labelWidget #133491
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added DropdownMenuEntry.labelWidget #133491
Conversation
3205856 to
24e2023
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we improve the required label later on? Somebody could now try to specify only labelWidget, but then they have to do label: '' as well. What if we have only a Widget label internally, and provide a .textLabel(String label) named constructor instead? (This is a breaking change though)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we always need a label, otherwise the search won't work, since the search always needs a text.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you made this a top level constant, you could access it from the test instead of duplicating it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When both label and labelWidget are specified, which one gets used for the semantics?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. The menu entry's MenuItemButton creates a TextButton which includes a container Semantics node, however the real semantics are provided by the labelWidget. So if your labelWidget doesn't include a Text widget or provide Semantics in some other way, then you've got an a11y problem. The same is true for all of the button classes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
TahaTesser
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
54f603c to
9f6ec9d
Compare
gspencergoog
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flutter/flutter@6c95737...1fe2495 2023-08-30 leroux_bruno@yahoo.fr Update SelectableRegion test for M3 (flutter/flutter#129627) 2023-08-30 godofredoc@google.com Remove cirrus tests from the flutter framework. (flutter/flutter#133575) 2023-08-30 engine-flutter-autoroll@skia.org Roll Flutter Engine from 749e67a947bc to 69f04bdfe952 (2 revisions) (flutter/flutter#133621) 2023-08-30 xilaizhang@google.com [flutter roll] Revert "Fix `Chip.shape`'s side is not used when provided in Material 3" (flutter/flutter#133615) 2023-08-30 engine-flutter-autoroll@skia.org Roll Flutter Engine from 9f2cf5c99b0f to 749e67a947bc (2 revisions) (flutter/flutter#133618) 2023-08-30 engine-flutter-autoroll@skia.org Roll Flutter Engine from c5854a6b3658 to 9f2cf5c99b0f (4 revisions) (flutter/flutter#133616) 2023-08-30 parlough@gmail.com No longer include `.packages` in created `.gitignore` files (flutter/flutter#133484) 2023-08-30 engine-flutter-autoroll@skia.org Roll Flutter Engine from db3ecf8b2739 to c5854a6b3658 (1 revision) (flutter/flutter#133610) 2023-08-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from 1feb9302050c to db3ecf8b2739 (4 revisions) (flutter/flutter#133609) 2023-08-29 polinach@google.com Fix one notDisposed leak and mark another. (flutter/flutter#133595) 2023-08-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from 01a1579808b5 to 1feb9302050c (1 revision) (flutter/flutter#133604) 2023-08-29 polinach@google.com Upgrade packages. (flutter/flutter#133593) 2023-08-29 polinach@google.com Cover more tests with leak tracking. (flutter/flutter#133596) 2023-08-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from 73cc3fb451fd to 01a1579808b5 (3 revisions) (flutter/flutter#133591) 2023-08-29 hans.muller@gmail.com Added DropdownMenuEntry.labelWidget (flutter/flutter#133491) 2023-08-29 ian@hixie.ch Use a fake stopwatch to remove flakiness. (flutter/flutter#133229) 2023-08-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from d1e6eb080f08 to 73cc3fb451fd (3 revisions) (flutter/flutter#133580) 2023-08-29 mdebbar@google.com [web] Migrate remaining web-only API usages to `dart:ui_web` (flutter/flutter#132248) 2023-08-29 gspencergoog@users.noreply.github.com Add doxygen doc generation. (flutter/flutter#131356) 2023-08-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from 50bd80773287 to d1e6eb080f08 (2 revisions) (flutter/flutter#133570) 2023-08-29 polinach@google.com ShortcutManager should dispatch creation in constructor. (flutter/flutter#133487) 2023-08-29 tessertaha@gmail.com Add FAB Additional Color Mappings example (flutter/flutter#133453) 2023-08-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from 65438c7bb46a to 50bd80773287 (1 revision) (flutter/flutter#133565) 2023-08-29 engine-flutter-autoroll@skia.org Roll Packages from 383bffa to d7d3150 (13 revisions) (flutter/flutter#133564) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC rmistry@google.com,stuartmorgan@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Fixes #126882
If the DropdownMenu's width is specified the menu items are now constrained to fit within the available horizontal space.
Added a
labelWidgetDropdownMenuEntry parameter to make it possible to override the automatically created label widget. By default the label widget isText(label)which precludes configuring the Text widget with parameters like maxLines or overflow.