Repository navigation
fix: apply Ruby layout keywords to ReorderableDragHandle - #7
Merged
AdamMusa merged 2 commits intoOct 28, 2026
Merged
Conversation
ReorderableDragHandle returned a bare ReorderableDragStartListener, so the layout keywords Ruby declares for it (width, height, margin, opacity, tooltip, badge, offset, rotate, scale, animate_*, on_size_change, ...) were dropped. The listener is now wrapped in LayoutControl like every other visual control. The listener stays inside the layout wrappers, so the sized area drags and the margin does not.
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
ReorderableDragHandle(shared/reorderabledraghandle_control.rb) declares the full set of common layout keywords:width,height,margin,opacity,tooltip,badge,offset,rotate,scale,align,aspect_ratio,animate_*,left/top/right/bottom,expand,on_size_change, and so on.reorderable_drag_handle.dartreturned a bareReorderableDragStartListenerwith noLayoutControl, so every layout keyword was silently dropped. For example,reorderable_drag_handle(content: icon, width: 40, height: 40, margin: 8)rendered at the icon's intrinsic size with no margin.Fix
The drag handle now wraps its listener in
LayoutControl(control: control, child: ReorderableDragStartListener(...))(base_controls.dart), like the other visual controls. The listener stays inside the layout wrappers. The sized area (width/height) is draggable, and the margin is outside the handle and does not start a drag.enabled: !control.disabledand themouse_cursorMouseRegionare unchanged.The control has no design-language widgets, so one file serves both Material and Cupertino. It works in both
MaterialReorderableListViewControl(ReorderableListView) andCupertinoReorderableListViewControl(ReorderableList).Tests
New
test/widgets/ruby_reorderable_drag_handle_test.dartuses aReorderableListViewwithshow_default_drag_handles: falseand three rows, each aReorderableDragHandle. It runs on iOS and macOS (Cupertino list) and on Android (Material list):width: 40, height: 30, margin: {left: 8, top: 10}gives a 40x30 listener rect at offset (8, 10) from its row.opacity: 0.5gives anOpacity(0.5)ancestor.reorderfires once with{old_index: 0, new_index: 1}, and row B is now above row A.disabled: truedoes not reorder.Before the fix, the 3 geometry cases failed (for example
Expected Size(40.0, 30.0), Actual Size(16.6, 17.0)on iOS). Drag, no-keyword and disabled cases passed, which shows the change does not regress dragging.verify_pr.sh <engine-wt> ""(Flutter 3.41.2):flutter test: +707, all passed (695 baseline + 12 new).flutter analyze lib test: no issues found.QA finding #14 (
qa-baseline.md: "ReorderableDragHandle … noLayoutControl/BaseControl… every layout keyword is ignored").