Skip to content

Commit cd654df

Browse files
authored
[animations] FadeThrough: Change scale from 95% to 92% (flutter#72)
1 parent 2173aa9 commit cd654df

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

packages/animations/lib/src/fade_through_transition.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,11 +351,11 @@ class _ZoomedFadeIn extends StatelessWidget {
351351
static final TweenSequence<double> _scaleIn = TweenSequence<double>(
352352
<TweenSequenceItem<double>>[
353353
TweenSequenceItem<double>(
354-
tween: ConstantTween<double>(0.95),
354+
tween: ConstantTween<double>(0.92),
355355
weight: 6 / 20,
356356
),
357357
TweenSequenceItem<double>(
358-
tween: Tween<double>(begin: 0.95, end: 1.0).chain(_inCurve),
358+
tween: Tween<double>(begin: 0.92, end: 1.0).chain(_inCurve),
359359
weight: 14 / 20,
360360
),
361361
],

packages/animations/test/fade_through_transition_test.dart

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ void main() {
5757
expect(_getOpacity(bottomRoute, tester), 1.0);
5858
// top route is at 95% of full size and not visible yet.
5959
expect(find.text(topRoute), findsOneWidget);
60-
expect(_getScale(topRoute, tester), 0.95);
60+
expect(_getScale(topRoute, tester), 0.92);
6161
expect(_getOpacity(topRoute, tester), 0.0);
6262

6363
// Jump to half-way through the fade out (total duration is 300ms, 6/12th of
@@ -71,7 +71,7 @@ void main() {
7171
expect(bottomOpacity, greaterThan(0.0));
7272
// Top route is still invisible.
7373
expect(find.text(topRoute), findsOneWidget);
74-
expect(_getScale(topRoute, tester), 0.95);
74+
expect(_getScale(topRoute, tester), 0.92);
7575
expect(_getOpacity(topRoute, tester), 0.0);
7676

7777
// Let's jump to the end of the fade-out.
@@ -82,7 +82,7 @@ void main() {
8282
expect(_getOpacity(bottomRoute, tester), 0.0);
8383
// Top route is still invisible.
8484
expect(find.text(topRoute), findsOneWidget);
85-
expect(_getScale(topRoute, tester), 0.95);
85+
expect(_getScale(topRoute, tester), 0.92);
8686
expect(_getOpacity(topRoute, tester), 0.0);
8787

8888
// Let's jump to the middle of the fade-in.
@@ -95,7 +95,7 @@ void main() {
9595
expect(find.text(topRoute), findsOneWidget);
9696
final double topScale = _getScale(topRoute, tester);
9797
final double topOpacity = _getOpacity(topRoute, tester);
98-
expect(topScale, greaterThan(0.95));
98+
expect(topScale, greaterThan(0.92));
9999
expect(topScale, lessThan(1.0));
100100
expect(topOpacity, greaterThan(0.0));
101101
expect(topOpacity, lessThan(1.0));
@@ -144,7 +144,7 @@ void main() {
144144
expect(_getOpacity(topRoute, tester), 1.0);
145145
// Bottom route is at 95% of full size and not visible yet.
146146
expect(find.text(bottomRoute), findsOneWidget);
147-
expect(_getScale(bottomRoute, tester), 0.95);
147+
expect(_getScale(bottomRoute, tester), 0.92);
148148
expect(_getOpacity(bottomRoute, tester), 0.0);
149149

150150
// Jump to half-way through the fade out (total duration is 300ms, 6/12th of
@@ -158,7 +158,7 @@ void main() {
158158
expect(topOpacity, greaterThan(0.0));
159159
// Top route is still invisible.
160160
expect(find.text(bottomRoute), findsOneWidget);
161-
expect(_getScale(bottomRoute, tester), 0.95);
161+
expect(_getScale(bottomRoute, tester), 0.92);
162162
expect(_getOpacity(bottomRoute, tester), 0.0);
163163

164164
// Let's jump to the end of the fade-out.
@@ -171,7 +171,7 @@ void main() {
171171
expect(find.text(bottomRoute), findsOneWidget);
172172
expect(
173173
_getScale(bottomRoute, tester),
174-
moreOrLessEquals(0.95, epsilon: 0.005),
174+
moreOrLessEquals(0.92, epsilon: 0.005),
175175
);
176176
expect(
177177
_getOpacity(bottomRoute, tester),
@@ -236,7 +236,7 @@ void main() {
236236
expect(find.text(topRoute), findsOneWidget);
237237
final double topScale = _getScale(topRoute, tester);
238238
final double topOpacity = _getOpacity(topRoute, tester);
239-
expect(topScale, greaterThan(0.95));
239+
expect(topScale, greaterThan(0.92));
240240
expect(topScale, lessThan(1.0));
241241
expect(topOpacity, greaterThan(0.0));
242242
expect(topOpacity, lessThan(1.0));
@@ -269,7 +269,7 @@ void main() {
269269
expect(_getScale(bottomRoute, tester), 1.0);
270270
expect(_getOpacity(bottomRoute, tester), 1.0);
271271
expect(find.text(topRoute), findsOneWidget);
272-
expect(_getScale(topRoute, tester), 0.95);
272+
expect(_getScale(topRoute, tester), 0.92);
273273
expect(_getOpacity(topRoute, tester), 0.0);
274274

275275
await tester.pump(const Duration(milliseconds: 1));

0 commit comments

Comments
 (0)