Repository navigation
fix: show dropdownMenu entries - #511
Conversation
The entry parser builds each entry as DropdownMenuEntry<dynamic>, because the model's value is dynamic. Since 1.5.0 the widget parser kept only DropdownMenuEntry<Object>, which a DropdownMenuEntry<dynamic> isn't, so every entry was dropped and the menu opened empty. initialSelection had nothing to match either, so the field stayed blank. The filter now keeps DropdownMenuEntry<Object?>, which matches every parsed entry and still drops nulls, and the widget is a DropdownMenu<Object?>. Entries without a value work again.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Flutter 3.50.0 is now the stable channel and pins newer versions of a few packages, so the pub get that melos-action runs before the format step rewrites the committed pubspec.lock files of counter_example, movie_app and stac_playground. validate-formatting.sh failed on any modified file, so every PR failed the format job. It now looks only at Dart files, the only files dart format changes.
Description
dropdownMenuopens an empty menu, whatever entries the JSON lists. This has been the case since 1.5.0.StacDropdownMenuEntryParserbuilds each entry asDropdownMenuEntry<dynamic>, because the model'svalueisdynamic. Since #452 the widget parser keeps onlyDropdownMenuEntry<Object>, and aDropdownMenuEntry<dynamic>isn't one, sowhereTyperemoved every entry.initialSelectionhad nothing to match either, so the field stayed blank.The filter now keeps
DropdownMenuEntry<Object?>and the widget is aDropdownMenu<Object?>. That keeps every parsed entry, still drops nulls, and doesn't bring back implicitdynamic. Entries without avaluework as they did before #452.Checked with a local widget test (not committed) on a menu with string, number and missing values:
DropdownMenu<Object>with 0 entries.initialSelection: "b"showsB, and picking an entry updates the field.Also: the
formatcheckThe
formatjob currently fails on every PR. CI now runs Flutter 3.50.0, and thepub getbefore the format step rewrites the committedpubspec.lockfiles ofcounter_example,movie_appandstac_playground.validate-formatting.shfailed on any modified file, so it now looks only at.dartfiles, the only onesdart formatchanges. The lock files themselves aren't updated here.Related Issues
None filed. Regression from #452.
Type of Change
Summary by CodeRabbit