-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: 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.team-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages teamwaiting for PR to land (fixed)A fix is in flightA fix is in flight
Description
Use case
I want to use different curves for expanding and collapsing ExpansionTile, but setting reverseCurve in expansionAnimationStyle doesn't seem to have any effect.
ExpansionTile(
expansionAnimationStyle: AnimationStyle(
curve: Curves.easeOutQuint,
reverseCurve: Curves.easeInQuint, // no effect
),
);Proposal
Please support reverseCurve in expansionAnimationStyle. I think this can be achieved by modifying expansion_tile.dart like this.
(line 569)
- final CurveTween _heightFactorTween = CurveTween(curve: Curves.easeIn);
+ final Tween<double> _heightFactorTween = Tween<double>(begin: 0.0, end: 1.0);
(line 573)
- late Animation<double> _heightFactor;
+ late CurvedAnimation _heightFactor;
(line 587)
- _heightFactor = _animationController.drive(_heightFactorTween);
+ _heightFactor = CurvedAnimation(
+ parent: _animationController.drive(_heightFactorTween),
+ curve: Curves.easeIn,
+ );
(line 865)
- _heightFactorTween.curve = widget.expansionAnimationStyle?.curve
+ _heightFactor.curve = widget.expansionAnimationStyle?.curve
?? expansionTileTheme.expansionAnimationStyle?.curve
?? Curves.easeIn;
+
+ _heightFactor.reverseCurve = widget.expansionAnimationStyle?.reverseCurve
+ ?? expansionTileTheme.expansionAnimationStyle?.reverseCurve
+ ?? Curves.easeIn;Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: 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.team-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages teamwaiting for PR to land (fixed)A fix is in flightA fix is in flight