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

How to override modal sheet closing animation? #415

Open
reyhaan opened this issue Jul 19, 2024 · 1 comment
Open

How to override modal sheet closing animation? #415

reyhaan opened this issue Jul 19, 2024 · 1 comment

Comments

@reyhaan
Copy link

reyhaan commented Jul 19, 2024

I have given it a custom animation curve that is very close to what iOS has natively, but the problem is, by default, when I close the modal sheet, it just runs the animation from 1.0 to 0.0 with same animation curve and its not ideal, I want it close the modal sheet with same animation curve as if it was run from 0.0 to 1.0.

this curve is basically fast -> slow and when it runs in reverse, it behaves like slow -> fast because of the reverse thingy, I would like to have it behave fast -> slow when closing.

showMaterialModalBottomSheet<Object>(
    useRootNavigator: true,
    expand: expand,
    context: context,
    builder: (context) => widget,
    animationCurve: const Cubic(0.1, 1, 0.2, 1),
 );
@reyhaan
Copy link
Author

reyhaan commented Jul 20, 2024

I managed to add another param to override closing animation for bottom sheet, here a draft PR: #417

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

No branches or pull requests

1 participant