woltapp / wolt_modal_sheet

This package provides a responsive modal with multiple pages, motion animation for page transitions, and scrollable content within each page.
MIT License
512 stars 65 forks source link

Fix: Consider directionality for pagination animation #272

Closed ulusoyca closed 4 months ago

ulusoyca commented 4 months ago

Summary

ThisPR introduces support for both Left-to-Right (LTR) and Right-to-Left (RTL) text directions in the slide animation logic for modal sheet page transitions. The mainContentSlidePosition method is updated to handle different slide directions based on a new isLTR parameter.

Changes

Calculated directionMultiplier based on isLTR and isForwardMove to correctly adjust the animation direction. For LTR (isLTR = true), the multiplier is 1 for forward moves and -1 for backward moves. For RTL (isLTR = false), the multiplier is -1 for forward moves and 1 for backward moves.

Before LTR After LTR
Before RTL After RTL

Related Issues

Fixes https://github.com/woltapp/wolt_modal_sheet/issues/266

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

https://github.com/user-attachments/assets/0b89e936-b90e-469e-907e-228e4c357607