This reverts commit e73d406106aefb5b1d4d06bb209d19618bd0e6ac. It caused major performance regressions.
This commit is contained in:
parent
2bda59a1fe
commit
9afc853f75
@ -24,14 +24,9 @@ class _MountainViewPageTransition extends StatelessWidget {
|
|||||||
parent: routeAnimation, // The route's linear 0.0 - 1.0 animation.
|
parent: routeAnimation, // The route's linear 0.0 - 1.0 animation.
|
||||||
curve: Curves.fastOutSlowIn,
|
curve: Curves.fastOutSlowIn,
|
||||||
)),
|
)),
|
||||||
_opacityAnimation = new CurvedAnimation(
|
|
||||||
parent: routeAnimation,
|
|
||||||
curve: Curves.easeIn, // Eyeballed from other Material apps.
|
|
||||||
),
|
|
||||||
super(key: key);
|
super(key: key);
|
||||||
|
|
||||||
final Animation<Offset> _positionAnimation;
|
final Animation<Offset> _positionAnimation;
|
||||||
final Animation<double> _opacityAnimation;
|
|
||||||
final Widget child;
|
final Widget child;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -39,10 +34,7 @@ class _MountainViewPageTransition extends StatelessWidget {
|
|||||||
// TODO(ianh): tell the transform to be un-transformed for hit testing
|
// TODO(ianh): tell the transform to be un-transformed for hit testing
|
||||||
return new SlideTransition(
|
return new SlideTransition(
|
||||||
position: _positionAnimation,
|
position: _positionAnimation,
|
||||||
child: new FadeTransition(
|
|
||||||
opacity: _opacityAnimation,
|
|
||||||
child: child,
|
child: child,
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,8 +28,6 @@ void main() {
|
|||||||
await tester.pump();
|
await tester.pump();
|
||||||
await tester.pump(const Duration(milliseconds: 1));
|
await tester.pump(const Duration(milliseconds: 1));
|
||||||
|
|
||||||
Opacity widget2Opacity =
|
|
||||||
tester.element(find.text('Page 2')).ancestorWidgetOfExactType(Opacity);
|
|
||||||
Offset widget2TopLeft = tester.getTopLeft(find.text('Page 2'));
|
Offset widget2TopLeft = tester.getTopLeft(find.text('Page 2'));
|
||||||
final Size widget2Size = tester.getSize(find.text('Page 2'));
|
final Size widget2Size = tester.getSize(find.text('Page 2'));
|
||||||
|
|
||||||
@ -37,10 +35,8 @@ void main() {
|
|||||||
expect(widget1TopLeft.dx == widget2TopLeft.dx, true);
|
expect(widget1TopLeft.dx == widget2TopLeft.dx, true);
|
||||||
// Page 1 is above page 2 mid-transition.
|
// Page 1 is above page 2 mid-transition.
|
||||||
expect(widget1TopLeft.dy < widget2TopLeft.dy, true);
|
expect(widget1TopLeft.dy < widget2TopLeft.dy, true);
|
||||||
// Animation begins 3/4 of the way up the page.
|
// Animation begins from the top of the page.
|
||||||
expect(widget2TopLeft.dy < widget2Size.height / 4.0, true);
|
expect(widget2TopLeft.dy < widget2Size.height, true);
|
||||||
// Animation starts with page 2 being near transparent.
|
|
||||||
expect(widget2Opacity.opacity < 0.01, true);
|
|
||||||
|
|
||||||
await tester.pump(const Duration(milliseconds: 300));
|
await tester.pump(const Duration(milliseconds: 300));
|
||||||
|
|
||||||
@ -52,14 +48,10 @@ void main() {
|
|||||||
await tester.pump();
|
await tester.pump();
|
||||||
await tester.pump(const Duration(milliseconds: 1));
|
await tester.pump(const Duration(milliseconds: 1));
|
||||||
|
|
||||||
widget2Opacity =
|
|
||||||
tester.element(find.text('Page 2')).ancestorWidgetOfExactType(Opacity);
|
|
||||||
widget2TopLeft = tester.getTopLeft(find.text('Page 2'));
|
widget2TopLeft = tester.getTopLeft(find.text('Page 2'));
|
||||||
|
|
||||||
// Page 2 starts to move down.
|
// Page 2 starts to move down.
|
||||||
expect(widget1TopLeft.dy < widget2TopLeft.dy, true);
|
expect(widget1TopLeft.dy < widget2TopLeft.dy, true);
|
||||||
// Page 2 starts to lose opacity.
|
|
||||||
expect(widget2Opacity.opacity < 1.0, true);
|
|
||||||
|
|
||||||
await tester.pump(const Duration(milliseconds: 300));
|
await tester.pump(const Duration(milliseconds: 300));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user