Skip to content

fix: honor Ruby movement and resize durations on Dismissible - #1

Merged
AdamMusa merged 1 commit into
codex/engine-initializationfrom
fix/dismissible-durations
Oct 28, 2026
Merged

AdamMusa merged 1 commit into
codex/engine-initializationfrom
fix/dismissible-durations

Conversation

@AdamMusa

Copy link
Copy Markdown
Owner

Summary

Ruby's Dismissible (shared/dismissible_control.rb) sends movement_duration and resize_duration. Both are integers in milliseconds, and Ruby defaults them to 200 and 300. There is no duration keyword. dismissible.dart read "duration" for both movementDuration and resizeDuration, so both Ruby values were dropped and the widget always used 200 ms and 300 ms.

Fix

  • movementDuration now reads movement_duration, with a default of 200 ms.
  • resizeDuration now reads resize_duration, with a default of 300 ms.

Dismissible uses a single renderer from flutter/widgets.dart, so this one fix covers both the Material and the Cupertino design. No other engine code reads the bad "duration" key for Dismissible. The other "duration" readers (AnimatedSwitcher, SnackBar, animation and method args) are their own Ruby keys.

Tests

New test/widgets/ruby_dismissible_keys_test.dart, run on iOS (Cupertino) and Android (Material):

  • It sends movement_duration: 1234 and resize_duration: 4321, then checks that Dismissible.movementDuration and Dismissible.resizeDuration are 1234 ms and 4321 ms. This failed before the fix (it got 200 ms).
  • Without the keys, the defaults stay 200 ms and 300 ms.

verify_pr.sh: flutter test +699, all passed (695 baseline + 4 new). flutter analyze lib test found no issues. Flutter 3.41.2.

QA finding #5

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