Repository navigation
fix: honor Ruby expanded_insets, selected_suffix and hover_color on Dropdown - #54
Merged
AdamMusa merged 2 commits intoOct 29, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ruby's canonical
Dropdown(materials/dropdown_control.rb) declaresexpanded_insets,selected_suffixandhover_color. The Material renderer (material_dropdown.dart, FlutterDropdownMenu) and the Cupertino renderer read none of them. Material derivedexpandedInsetsonly fromexpand. Upstream Flet's Dart doesn't apply these keys either. The descriptions below come from Flet's Python docs.Fix
Material
expanded_insets(padding) now goes toDropdownMenu.expandedInsets. When it is absent, the oldexpand > 0 → EdgeInsets.zerorule still applies.hover_colornow goes toInputDecorationTheme.hoverColor, which is the text field's hover fill.selected_suffix(a control) is "displayed after the selected item".DropdownMenuhas no suffix slot, so when this key is set the renderer usesDropdownMenu.decorationBuilderand puts the control inInputDecoration.suffix. The builder now also carrieslabel,hint_text,helper_text,error_textandleading_icon, because Flutter asserts that those are not passed both ways. The default arrow button is kept, sincesuffixIconstays null. Whenselected_suffixis absent, the existing code path is unchanged.Cupertino (
cupertino_input_controls.dart)selected_suffixis shown in the field's suffix, before the chevron button, only while an option is selected.expanded_insetsandhover_colorare not applied, because they have no Cupertino equivalent. The iOS dropdown is a field that opens a bottom picker sheet, so there is no inline menu to inset, andCupertinoTextFieldhas no hover fill. This is inherent to the design language.git merge-treeshows clean merges with #10 (DropdownM2) and #43 (SearchBar), which touch the same Cupertino file.Tests
New
test/widgets/ruby_dropdown_keys_test.dart:expanded_insets {left: 8, right: 16}setsDropdownMenu.expandedInsets, and the field is 400 − 24 = 376 px wide.hover_colorreaches the builtTextFielddecoration.selected_suffixsets the decorationsuffix. Label and helper are kept, and the arrowsuffixIconis kept.The first four failed before the fix. The "hidden" test passes on both, as a guard.
verify_pr.sh:flutter test+700, all passed (695 baseline + 5 new).flutter analyze lib testfound no issues. Flutter 3.41.2.Wave-2 follow-up E6