Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
e73d4061
Commit
e73d4061
authored
Nov 22, 2017
by
Pascal Welsch
Committed by
Ian Hickson
Nov 22, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reenable fade transition for Material page transition (#13048)
Fixes #12877 by reverting #9472
parent
3dc32873
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
3 deletions
+19
-3
page.dart
packages/flutter/lib/src/material/page.dart
+9
-1
page_test.dart
packages/flutter/test/material/page_test.dart
+10
-2
No files found.
packages/flutter/lib/src/material/page.dart
View file @
e73d4061
...
...
@@ -24,9 +24,14 @@ class _MountainViewPageTransition extends StatelessWidget {
parent:
routeAnimation
,
// The route's linear 0.0 - 1.0 animation.
curve:
Curves
.
fastOutSlowIn
,
)),
_opacityAnimation
=
new
CurvedAnimation
(
parent:
routeAnimation
,
curve:
Curves
.
easeIn
,
// Eyeballed from other Material apps.
),
super
(
key:
key
);
final
Animation
<
Offset
>
_positionAnimation
;
final
Animation
<
double
>
_opacityAnimation
;
final
Widget
child
;
@override
...
...
@@ -34,7 +39,10 @@ class _MountainViewPageTransition extends StatelessWidget {
// TODO(ianh): tell the transform to be un-transformed for hit testing
return
new
SlideTransition
(
position:
_positionAnimation
,
child:
child
,
child:
new
FadeTransition
(
opacity:
_opacityAnimation
,
child:
child
,
),
);
}
}
...
...
packages/flutter/test/material/page_test.dart
View file @
e73d4061
...
...
@@ -28,6 +28,8 @@ void main() {
await
tester
.
pump
();
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'
));
final
Size
widget2Size
=
tester
.
getSize
(
find
.
text
(
'Page 2'
));
...
...
@@ -35,8 +37,10 @@ void main() {
expect
(
widget1TopLeft
.
dx
==
widget2TopLeft
.
dx
,
true
);
// Page 1 is above page 2 mid-transition.
expect
(
widget1TopLeft
.
dy
<
widget2TopLeft
.
dy
,
true
);
// Animation begins from the top of the page.
expect
(
widget2TopLeft
.
dy
<
widget2Size
.
height
,
true
);
// Animation begins 3/4 of the way up the page.
expect
(
widget2TopLeft
.
dy
<
widget2Size
.
height
/
4.0
,
true
);
// Animation starts with page 2 being near transparent.
expect
(
widget2Opacity
.
opacity
<
0.01
,
true
);
await
tester
.
pump
(
const
Duration
(
milliseconds:
300
));
...
...
@@ -48,10 +52,14 @@ void main() {
await
tester
.
pump
();
await
tester
.
pump
(
const
Duration
(
milliseconds:
1
));
widget2Opacity
=
tester
.
element
(
find
.
text
(
'Page 2'
)).
ancestorWidgetOfExactType
(
Opacity
);
widget2TopLeft
=
tester
.
getTopLeft
(
find
.
text
(
'Page 2'
));
// Page 2 starts to move down.
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
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment