Commit 8a20b261 authored by Dragoș Tiselice's avatar Dragoș Tiselice Committed by GitHub

Changed Material ease animations to fastOutSlowIn. (#5643)

Fixes #5393.
parent c57635f1
...@@ -122,7 +122,7 @@ class _PointDemoState extends State<_PointDemo> { ...@@ -122,7 +122,7 @@ class _PointDemoState extends State<_PointDemo> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
_animation = new CurvedAnimation(parent: config.controller, curve: Curves.ease); _animation = new CurvedAnimation(parent: config.controller, curve: Curves.fastOutSlowIn);
} }
@override @override
...@@ -287,7 +287,7 @@ class _RectangleDemoState extends State<_RectangleDemo> { ...@@ -287,7 +287,7 @@ class _RectangleDemoState extends State<_RectangleDemo> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
_animation = new CurvedAnimation(parent: config.controller, curve: Curves.ease); _animation = new CurvedAnimation(parent: config.controller, curve: Curves.fastOutSlowIn);
} }
@override @override
......
...@@ -24,8 +24,8 @@ class _ProgressIndicatorDemoState extends State<ProgressIndicatorDemo> { ...@@ -24,8 +24,8 @@ class _ProgressIndicatorDemoState extends State<ProgressIndicatorDemo> {
_animation = new CurvedAnimation( _animation = new CurvedAnimation(
parent: _controller, parent: _controller,
curve: new Interval(0.0, 0.9, curve: Curves.ease), curve: new Interval(0.0, 0.9, curve: Curves.fastOutSlowIn),
reverseCurve: Curves.ease reverseCurve: Curves.fastOutSlowIn
)..addStatusListener((AnimationStatus status) { )..addStatusListener((AnimationStatus status) {
if (status == AnimationStatus.dismissed) if (status == AnimationStatus.dismissed)
_controller.forward(); _controller.forward();
......
...@@ -281,7 +281,7 @@ class AppBar extends StatelessWidget { ...@@ -281,7 +281,7 @@ class AppBar extends StatelessWidget {
final double toolBarOpacity = _toolBarOpacity(size.height, statusBarHeight); final double toolBarOpacity = _toolBarOpacity(size.height, statusBarHeight);
if (toolBarOpacity != 1.0) { if (toolBarOpacity != 1.0) {
final double opacity = const Interval(0.25, 1.0, curve: Curves.ease).transform(toolBarOpacity); final double opacity = const Interval(0.25, 1.0, curve: Curves.fastOutSlowIn).transform(toolBarOpacity);
if (centerStyle?.color != null) if (centerStyle?.color != null)
centerStyle = centerStyle.copyWith(color: centerStyle.color.withOpacity(opacity)); centerStyle = centerStyle.copyWith(color: centerStyle.color.withOpacity(opacity));
if (sideStyle?.color != null) if (sideStyle?.color != null)
...@@ -357,7 +357,7 @@ class AppBar extends StatelessWidget { ...@@ -357,7 +357,7 @@ class AppBar extends StatelessWidget {
appBar, appBar,
bottomOpacity == 1.0 ? bottom : new Opacity( bottomOpacity == 1.0 ? bottom : new Opacity(
child: bottom, child: bottom,
opacity: const Interval(0.25, 1.0, curve: Curves.ease).transform(bottomOpacity) opacity: const Interval(0.25, 1.0, curve: Curves.fastOutSlowIn).transform(bottomOpacity)
) )
] ]
); );
......
...@@ -693,7 +693,7 @@ class _SortArrowState extends State<_SortArrow> { ...@@ -693,7 +693,7 @@ class _SortArrowState extends State<_SortArrow> {
parent: _opacityController = new AnimationController( parent: _opacityController = new AnimationController(
duration: config.duration duration: config.duration
), ),
curve: Curves.ease curve: Curves.fastOutSlowIn
) )
..addListener(_rebuild); ..addListener(_rebuild);
_opacityController.value = config.visible ? 1.0 : 0.0; _opacityController.value = config.visible ? 1.0 : 0.0;
......
...@@ -94,7 +94,7 @@ class Input extends StatefulWidget { ...@@ -94,7 +94,7 @@ class Input extends StatefulWidget {
} }
const Duration _kTransitionDuration = const Duration(milliseconds: 200); const Duration _kTransitionDuration = const Duration(milliseconds: 200);
const Curve _kTransitionCurve = Curves.ease; const Curve _kTransitionCurve = Curves.fastOutSlowIn;
class _InputState extends State<Input> { class _InputState extends State<Input> {
GlobalKey<RawInputLineState> _rawInputLineKey = new GlobalKey<RawInputLineState>(); GlobalKey<RawInputLineState> _rawInputLineKey = new GlobalKey<RawInputLineState>();
......
...@@ -264,7 +264,7 @@ class _MaterialState extends State<Material> { ...@@ -264,7 +264,7 @@ class _MaterialState extends State<Material> {
} }
if (config.type != MaterialType.transparency) { if (config.type != MaterialType.transparency) {
contents = new AnimatedContainer( contents = new AnimatedContainer(
curve: Curves.ease, curve: Curves.fastOutSlowIn,
duration: kThemeChangeDuration, duration: kThemeChangeDuration,
decoration: new BoxDecoration( decoration: new BoxDecoration(
borderRadius: kMaterialEdges[config.type], borderRadius: kMaterialEdges[config.type],
......
...@@ -151,11 +151,11 @@ class _MergeableMaterialState extends State<MergeableMaterial> { ...@@ -151,11 +151,11 @@ class _MergeableMaterialState extends State<MergeableMaterial> {
final CurvedAnimation startAnimation = new CurvedAnimation( final CurvedAnimation startAnimation = new CurvedAnimation(
parent: controller, parent: controller,
curve: Curves.ease curve: Curves.fastOutSlowIn
); );
final CurvedAnimation endAnimation = new CurvedAnimation( final CurvedAnimation endAnimation = new CurvedAnimation(
parent: controller, parent: controller,
curve: Curves.ease curve: Curves.fastOutSlowIn
); );
startAnimation.addListener(_handleTick); startAnimation.addListener(_handleTick);
...@@ -163,8 +163,7 @@ class _MergeableMaterialState extends State<MergeableMaterial> { ...@@ -163,8 +163,7 @@ class _MergeableMaterialState extends State<MergeableMaterial> {
final CurvedAnimation gapAnimation = new CurvedAnimation( final CurvedAnimation gapAnimation = new CurvedAnimation(
parent: controller, parent: controller,
curve: Curves.ease, curve: Curves.fastOutSlowIn
reverseCurve: Curves.ease
); );
gapAnimation.addListener(_handleTick); gapAnimation.addListener(_handleTick);
......
...@@ -106,7 +106,7 @@ class _ScrollbarState extends State<Scrollbar> { ...@@ -106,7 +106,7 @@ class _ScrollbarState extends State<Scrollbar> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
_opacity = new CurvedAnimation(parent: _fade, curve: Curves.ease); _opacity = new CurvedAnimation(parent: _fade, curve: Curves.fastOutSlowIn);
} }
@override @override
......
...@@ -213,7 +213,7 @@ class _RenderSlider extends RenderConstrainedBox implements SemanticActionHandle ...@@ -213,7 +213,7 @@ class _RenderSlider extends RenderConstrainedBox implements SemanticActionHandle
_reactionController = new AnimationController(duration: kRadialReactionDuration); _reactionController = new AnimationController(duration: kRadialReactionDuration);
_reaction = new CurvedAnimation( _reaction = new CurvedAnimation(
parent: _reactionController, parent: _reactionController,
curve: Curves.ease curve: Curves.fastOutSlowIn
)..addListener(markNeedsPaint); )..addListener(markNeedsPaint);
_position = new AnimationController( _position = new AnimationController(
value: value, value: value,
...@@ -229,7 +229,7 @@ class _RenderSlider extends RenderConstrainedBox implements SemanticActionHandle ...@@ -229,7 +229,7 @@ class _RenderSlider extends RenderConstrainedBox implements SemanticActionHandle
return; return;
_value = newValue; _value = newValue;
if (divisions != null) if (divisions != null)
_position.animateTo(newValue, curve: Curves.ease); _position.animateTo(newValue, curve: Curves.fastOutSlowIn);
else else
_position.value = newValue; _position.value = newValue;
} }
......
...@@ -1188,10 +1188,10 @@ class _TabBarViewState<T> extends PageableListState<TabBarView<T>> implements Ta ...@@ -1188,10 +1188,10 @@ class _TabBarViewState<T> extends PageableListState<TabBarView<T>> implements Ta
if (selectedIndex < previousSelectedIndex) { if (selectedIndex < previousSelectedIndex) {
_updateItemsFromChildren(selectedIndex, previousSelectedIndex); _updateItemsFromChildren(selectedIndex, previousSelectedIndex);
scrollTo(new CurveTween(curve: Curves.ease.flipped).evaluate(new ReverseAnimation(animation))); scrollTo(new CurveTween(curve: Curves.fastOutSlowIn.flipped).evaluate(new ReverseAnimation(animation)));
} else { } else {
_updateItemsFromChildren(previousSelectedIndex, selectedIndex); _updateItemsFromChildren(previousSelectedIndex, selectedIndex);
scrollTo(new CurveTween(curve: Curves.ease).evaluate(animation)); scrollTo(new CurveTween(curve: Curves.fastOutSlowIn).evaluate(animation));
} }
} }
...@@ -1296,7 +1296,7 @@ class TabPageSelector<T> extends StatelessWidget { ...@@ -1296,7 +1296,7 @@ class TabPageSelector<T> extends StatelessWidget {
final Color color = Theme.of(context).accentColor; final Color color = Theme.of(context).accentColor;
final ColorTween selectedColor = new ColorTween(begin: Colors.transparent, end: color); final ColorTween selectedColor = new ColorTween(begin: Colors.transparent, end: color);
final ColorTween previousColor = new ColorTween(begin: color, end: Colors.transparent); final ColorTween previousColor = new ColorTween(begin: color, end: Colors.transparent);
Animation<double> animation = new CurvedAnimation(parent: selection.animation, curve: Curves.ease); Animation<double> animation = new CurvedAnimation(parent: selection.animation, curve: Curves.fastOutSlowIn);
return new AnimatedBuilder( return new AnimatedBuilder(
animation: animation, animation: animation,
builder: (BuildContext context, Widget child) { builder: (BuildContext context, Widget child) {
......
...@@ -416,7 +416,7 @@ class _DialState extends State<_Dial> { ...@@ -416,7 +416,7 @@ class _DialState extends State<_Dial> {
_thetaTween = new Tween<double>(begin: _getThetaForTime(config.selectedTime)); _thetaTween = new Tween<double>(begin: _getThetaForTime(config.selectedTime));
_theta = _thetaTween.animate(new CurvedAnimation( _theta = _thetaTween.animate(new CurvedAnimation(
parent: _thetaController, parent: _thetaController,
curve: Curves.ease curve: Curves.fastOutSlowIn
))..addListener(() => setState(() { })); ))..addListener(() => setState(() { }));
} }
......
...@@ -54,7 +54,7 @@ abstract class RenderToggleable extends RenderConstrainedBox implements Semantic ...@@ -54,7 +54,7 @@ abstract class RenderToggleable extends RenderConstrainedBox implements Semantic
_reactionController = new AnimationController(duration: kRadialReactionDuration); _reactionController = new AnimationController(duration: kRadialReactionDuration);
_reaction = new CurvedAnimation( _reaction = new CurvedAnimation(
parent: _reactionController, parent: _reactionController,
curve: Curves.ease curve: Curves.fastOutSlowIn
)..addListener(markNeedsPaint); )..addListener(markNeedsPaint);
} }
......
...@@ -138,7 +138,7 @@ class _TooltipState extends State<Tooltip> { ...@@ -138,7 +138,7 @@ class _TooltipState extends State<Tooltip> {
padding: config.padding, padding: config.padding,
animation: new CurvedAnimation( animation: new CurvedAnimation(
parent: _controller, parent: _controller,
curve: Curves.ease curve: Curves.fastOutSlowIn
), ),
target: target, target: target,
verticalOffset: config.verticalOffset, verticalOffset: config.verticalOffset,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment