Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set page transition animation duration #229

Closed
blingkonnerth opened this issue Jun 6, 2024 · 6 comments
Closed

Set page transition animation duration #229

blingkonnerth opened this issue Jun 6, 2024 · 6 comments
Assignees
Labels

Comments

@blingkonnerth
Copy link

Bug report

Describe the bug
In the documentation is a video, where you can clearly see a page animation transition, where the old page content fades out and the new page fades in.

I implemented a simple WoltModalSheet, but that animation is too fast for me. The fade animation is not even really visible, so I tried setting the animationDuration, but no matter to what I set it, nothing changes.

Steps to reproduce

Steps to reproduce the behavior:

  1. Set transitionDuration in WoltModalSheet
    await WoltModalSheet.show<void>(
      context: context,
      transitionDuration: const Duration(seconds: 3),
  1. Navigate via showNext and showPrevious

Expected behavior

I would expect that the page animation is as long as I set it inside transitionDuration.

Additional Context

I would like to achieve the effect as mentioned in the doc under Motion Animation

@blingkonnerth blingkonnerth added bug Something isn't working in triage labels Jun 6, 2024
@ulusoyca ulusoyca self-assigned this Jun 7, 2024
@ulusoyca
Copy link
Collaborator

ulusoyca commented Jun 7, 2024

Hi! I think there is a misunderstanding here. transitionDuration is used for the modal route, not for in-modal navigation.

/// The transitionDuration argument is used to determine how long it takes
/// for the route to arrive on or leave off the screen. This argument defaults
/// to 200 milliseconds.

I would suggest you to achieve this with WoltModalSheetAnimationStyle example from the ReadMe:

WoltModalSheetThemeData(
  animationStyle: WoltModalSheetAnimationStyle(
    paginationAnimationStyle: WoltModalSheetPaginationAnimationStyle(
      mainContentIncomingOpacityCurve: const Interval(
        150 / 350,
        350 / 350,
        curve: Curves.linear,
      ),
      modalSheetHeightTransitionCurve: const Interval(
        0 / 350,
        300 / 350,
        curve: Curves.fastOutSlowIn,
      ),
      incomingSabOpacityCurve: const Interval(
        100 / 350,
        300 / 350,
        curve: Curves.linear,
      ),
      // Define additional pagination animation styles as needed.
    ),
    scrollAnimationStyle: WoltModalSheetScrollAnimationStyle(
      heroImageScaleStart: 1.0,
      heroImageScaleEnd: 0.9,
      topBarTitleTranslationYInPixels: 8.0,
      topBarTranslationYInPixels: 4.0,
      // Define additional scroll animation styles as needed.
    ),
  ),
),

@blingkonnerth
Copy link
Author

@ulusoyca I thought the same, but when setting the transitionDuration lets say to 3 seconds, and I am presenting the sheet with WoltModalSheet.show, nothing changes. So I wonder, what transitionDuratin is actually doing?

Also, I tried setting the theme, but like in your example, I could only find ways to set the curves, not the actual duration

@ulusoyca
Copy link
Collaborator

@ulusoyca I thought the same, but when setting the transitionDuration lets say to 3 seconds, and I am presenting the sheet with WoltModalSheet.show, nothing changes. So I wonder, what transitionDuratin is actually doing?

Also, I tried setting the theme, but like in your example, I could only find ways to set the curves, not the actual duration

Found out the root cause. Working on the fix 👍🏻 Thanks for reporting 🙇🏻

@auradigitaldev
Copy link

@ulusoyca I thought the same, but when setting the transitionDuration lets say to 3 seconds, and I am presenting the sheet with WoltModalSheet.show, nothing changes. So I wonder, what transitionDuratin is actually doing?
Also, I tried setting the theme, but like in your example, I could only find ways to set the curves, not the actual duration

Found out the root cause. Working on the fix 👍🏻 Thanks for reporting 🙇🏻

Just to confirm, when you mention the fix, do you mean a fix for being able to control the animation duration only for modal open/close or also for transitions between multi-page modals?

@ulusoyca
Copy link
Collaborator

ulusoyca commented Jun 19, 2024

@ulusoyca
Copy link
Collaborator

ulusoyca commented Jul 2, 2024

@ulusoyca ulusoyca closed this as completed Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants