Skip to content

fix: show dropdownMenu entries - #511

Merged
divyanshub024 merged 2 commits into
mainfrom
dv/fix-dropdown-menu-entries
Nov 19, 2026
Merged

divyanshub024 merged 2 commits into
mainfrom
dv/fix-dropdown-menu-entries

Conversation

@divyanshub024

@divyanshub024 divyanshub024 commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Description

dropdownMenu opens an empty menu, whatever entries the JSON lists. This has been the case since 1.5.0.

StacDropdownMenuEntryParser builds each entry as DropdownMenuEntry<dynamic>, because the model's value is dynamic. Since #452 the widget parser keeps only DropdownMenuEntry<Object>, and a DropdownMenuEntry<dynamic> isn't one, so whereType removed every entry. initialSelection had nothing to match either, so the field stayed blank.

The filter now keeps DropdownMenuEntry<Object?> and the widget is a DropdownMenu<Object?>. That keeps every parsed entry, still drops nulls, and doesn't bring back implicit dynamic. Entries without a value work as they did before #452.

Checked with a local widget test (not committed) on a menu with string, number and missing values:

  • Before: DropdownMenu<Object> with 0 entries.
  • After: all 4 entries, initialSelection: "b" shows B, and picking an entry updates the field.

Also: the format check

The format job currently fails on every PR. CI now runs Flutter 3.50.0, and the pub get 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 it now looks only at .dart files, the only ones dart format changes. The lock files themselves aren't updated here.

Related Issues

None filed. Regression from #452.

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Code refactor
  • Build configuration change
  • Documentation
  • Chore

Summary by CodeRabbit

  • Bug Fixes
    • Dropdown menus now retain options with null values, keeping them available alongside other options. This provides more consistent menu behavior when an option has no assigned value. The change applies to how menu entries are handled; it does not add new menu controls or change the appearance of the menus.

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.
@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The dropdown menu parser now accepts nullable entry values. The formatting check now considers only modified tracked Dart files.

Changes: Dropdown Entry Parsing

Layer / File(s) Summary
Allow nullable dropdown entries
packages/stac/lib/src/parsers/widgets/stac_dropdown_menu/stac_dropdown_menu_parser.dart
The parser uses Object? for the dropdown menu, parsed entries, and empty-list fallback. Its type filter can retain entries with nullable values.

Formatting Check Filter

Layer / File(s) Summary
Filter formatting checks to Dart files
.github/workflows/scripts/validate-formatting.sh
The modified-file checks and reporting loop now filter tracked files to include only *.dart files.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: divyanshubhargavasecurrency

Merge Risk: Minimal · up to 90816

This change restores dropdown menu entries that were being filtered out and narrows the CI formatting check to Dart files. No actionable merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "fix: show dropdownMenu entries" matches the main change. The PR fixes dropdownMenu entries disappearing because the widget parser filtered out every entry, by changing the type from Dropdow…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix: show dropdownMenu entries" matches the main change. The PR fixes dropdownMenu entries disappearing because the widget parser filtered out every entry, by changing the type from DropdownMenuEntry<Object> to DropdownMenuEntry<Object?>. The title is short, specific, and uses a conventional commit prefix. The secondary formatting-script change is not mentioned, which is acceptable because the title need not cover every detail.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f493e0d1-33bc-4209-97b3-9fc9009a4d16
Commits

Reviewing files that changed from the base of the PR and between e8e526b and 9081653.

Files selected for processing: 1

  • .github/workflows/scripts/validate-formatting.sh

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

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.
@divyanshub024
divyanshub024 merged commit 3cb13ef into main Nov 19, 2026
6 checks passed
@divyanshub024
divyanshub024 deleted the dv/fix-dropdown-menu-entries branch November 19, 2026 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant