-
Notifications
You must be signed in to change notification settings - Fork 26.7k
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
[Proposal] Allow disabling the scaling animation of the FloatingActionButton #145585
Comments
@TahaTesser - Maybe this could be handled by giving FAB a pair of AnimationStyle parameters? Or maybe just a fix for the way FloatingActionButtonAnimator is handled is what's needed. |
This would be for Scaffold. floatingActionButtonAnimator |
floatingActionButtonAnimator is bit niche for AnimationStyle. Since this is implemented and handled by Scaffold. |
I was trying to imply FAB.scaleAnimationStyle and FAB.rotationAnimationStyle. But I think you're right. The animations are a feature of the Scaffold, not FAB. Maybe we just have a bug here? |
Yep, the bug is default entrance and exit animation curves are hard coded and combined with custom AlwaysStopAnimation curve, as a result you still get defaults curves. My fix will try to override the default entrance and exit animations so we could disable the entrance and exit animations entirely with new |
…ations using `FloatingActionButtonAnimator.noAnimation` (#146126) fixes [[Proposal] Allow disabling the scaling animation of the FloatingActionButton](#145585) ### Using default `FloatingActionButton` animations ![ScreenRecording2024-04-02at16 19 03-ezgif com-video-to-gif-converter](https://github.com/flutter/flutter/assets/48603081/627ea564-7f60-4eb4-bed9-95c053ae2f56) ### Using `FloatingActionButtonAnimator.noAnimation` ![ScreenRecording2024-04-02at16 17 20-ezgif com-video-to-gif-converter](https://github.com/flutter/flutter/assets/48603081/d0a936ea-9e16-4225-8dc4-40a11ee8a975)
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Use case
Currently when the FloatingActionButton widget is added or removed from a Scaffold, it animates its transition.
We can control parts of this transition, using the
FloatingActionButtonAnimator
. By default this uses the scaling animator from the framework itself.However, if I want to disable both the rotation and scaling animations with the following animator subclass:
and I pass an instance to the
floatingActionButtonAnimator
of a Scaffold, I still see a scale transition on the FAB.Proposal
Allow disabling both the scaling and rotation transition, using the aforementioned
FloatingActionButtonAnimator
, either through a subclass, or by providing aFloatingActionButtonAnimator.noAnimation
constant.The text was updated successfully, but these errors were encountered: