-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Closed
Copy link
Labels
a: animationAnimation APIsAnimation APIsc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.r: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamOwned by Design Languages team
Description
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:
class _NoAnimationFloatingActionButtonAnimator extends FloatingActionButtonAnimator {
const _NoAnimationFloatingActionButtonAnimator();
@override
Offset getOffset({required Offset begin, required Offset end, required double progress}) {
return end;
}
@override
Animation<double> getRotationAnimation({required Animation<double> parent}) {
return const AlwaysStoppedAnimation(1.0);
}
@override
Animation<double> getScaleAnimation({required Animation<double> parent}) {
return const AlwaysStoppedAnimation(1.0);
}
}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 a FloatingActionButtonAnimator.noAnimation constant.
bilalhamud
Metadata
Metadata
Assignees
Labels
a: animationAnimation APIsAnimation APIsc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.r: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamOwned by Design Languages team
Type
Projects
Status
Done (PR merged)