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
511 stars 64 forks source link

Prevent crashes during pagination and enable pagination duration configuration in animation style. #280

Closed ulusoyca closed 3 months ago

ulusoyca commented 3 months ago

Description

This PR addresses animation issues and assertion errors that occur during pagination animation in the WoltModalSheetAnimatedSwitcher component. To address these issues:

  1. Ensured when the animation completes, setState is only called when the widget is still mounted to avoid potential issues if the widget is disposed during the animation.
  2. Wrapped the switcher with AbsorbPointer to prevent crashes caused by interaction that changes page.
  3. Enabled setting the pagination duration animation through the AnimationStyle.

Related Issues

279

Before After

Custom pagination animation duration:

350 ms 1500 ms

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?

ibraheemalayan commented 3 months ago

@TahaTesser @ulusoyca

Is it possible to release the new version today? we have to proceed with publishing the new app version