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
20e214fa
Commit
20e214fa
authored
Apr 05, 2017
by
Hans Muller
Committed by
GitHub
Apr 05, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document the buildTransitions() method (#9182)
parent
896ffcdf
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
146 additions
and
54 deletions
+146
-54
shrine_demo.dart
examples/flutter_gallery/lib/demo/shrine_demo.dart
+2
-2
bottom_sheet.dart
packages/flutter/lib/src/material/bottom_sheet.dart
+1
-1
dialog.dart
packages/flutter/lib/src/material/dialog.dart
+2
-2
dropdown.dart
packages/flutter/lib/src/material/dropdown.dart
+1
-1
page.dart
packages/flutter/lib/src/material/page.dart
+3
-3
popup_menu.dart
packages/flutter/lib/src/material/popup_menu.dart
+1
-1
pages.dart
packages/flutter/lib/src/widgets/pages.dart
+7
-7
routes.dart
packages/flutter/lib/src/widgets/routes.dart
+126
-34
app_overrides_test.dart
packages/flutter/test/widgets/app_overrides_test.dart
+1
-1
page_forward_transitions_test.dart
...s/flutter/test/widgets/page_forward_transitions_test.dart
+2
-2
No files found.
examples/flutter_gallery/lib/demo/shrine_demo.dart
View file @
20e214fa
...
...
@@ -29,8 +29,8 @@ class ShrinePageRoute<T> extends MaterialPageRoute<T> {
})
:
super
(
builder:
builder
,
settings:
settings
);
@override
Widget
buildPage
(
BuildContext
context
,
Animation
<
double
>
animation
,
Animation
<
double
>
forward
Animation
)
{
return
buildShrine
(
context
,
super
.
buildPage
(
context
,
animation
,
forward
Animation
));
Widget
buildPage
(
BuildContext
context
,
Animation
<
double
>
animation
,
Animation
<
double
>
secondary
Animation
)
{
return
buildShrine
(
context
,
super
.
buildPage
(
context
,
animation
,
secondary
Animation
));
}
}
...
...
packages/flutter/lib/src/material/bottom_sheet.dart
View file @
20e214fa
...
...
@@ -231,7 +231,7 @@ class _ModalBottomSheetRoute<T> extends PopupRoute<T> {
}
@override
Widget
buildPage
(
BuildContext
context
,
Animation
<
double
>
animation
,
Animation
<
double
>
forward
Animation
)
{
Widget
buildPage
(
BuildContext
context
,
Animation
<
double
>
animation
,
Animation
<
double
>
secondary
Animation
)
{
Widget
bottomSheet
=
new
_ModalBottomSheet
<
T
>(
route:
this
);
if
(
theme
!=
null
)
bottomSheet
=
new
Theme
(
data:
theme
,
child:
bottomSheet
);
...
...
packages/flutter/lib/src/material/dialog.dart
View file @
20e214fa
...
...
@@ -337,12 +337,12 @@ class _DialogRoute<T> extends PopupRoute<T> {
Color
get
barrierColor
=>
Colors
.
black54
;
@override
Widget
buildPage
(
BuildContext
context
,
Animation
<
double
>
animation
,
Animation
<
double
>
forward
Animation
)
{
Widget
buildPage
(
BuildContext
context
,
Animation
<
double
>
animation
,
Animation
<
double
>
secondary
Animation
)
{
return
theme
!=
null
?
new
Theme
(
data:
theme
,
child:
child
)
:
child
;
}
@override
Widget
buildTransitions
(
BuildContext
context
,
Animation
<
double
>
animation
,
Animation
<
double
>
forward
Animation
,
Widget
child
)
{
Widget
buildTransitions
(
BuildContext
context
,
Animation
<
double
>
animation
,
Animation
<
double
>
secondary
Animation
,
Widget
child
)
{
return
new
FadeTransition
(
opacity:
new
CurvedAnimation
(
parent:
animation
,
...
...
packages/flutter/lib/src/material/dropdown.dart
View file @
20e214fa
...
...
@@ -313,7 +313,7 @@ class _DropdownRoute<T> extends PopupRoute<_DropdownRouteResult<T>> {
Color
get
barrierColor
=>
null
;
@override
Widget
buildPage
(
BuildContext
context
,
Animation
<
double
>
animation
,
Animation
<
double
>
forward
Animation
)
{
Widget
buildPage
(
BuildContext
context
,
Animation
<
double
>
animation
,
Animation
<
double
>
secondary
Animation
)
{
Widget
menu
=
new
_DropdownMenu
<
T
>(
route:
this
);
if
(
theme
!=
null
)
menu
=
new
Theme
(
data:
theme
,
child:
menu
);
...
...
packages/flutter/lib/src/material/page.dart
View file @
20e214fa
...
...
@@ -149,7 +149,7 @@ class MaterialPageRoute<T> extends PageRoute<T> {
}
@override
Widget
buildPage
(
BuildContext
context
,
Animation
<
double
>
animation
,
Animation
<
double
>
forward
Animation
)
{
Widget
buildPage
(
BuildContext
context
,
Animation
<
double
>
animation
,
Animation
<
double
>
secondary
Animation
)
{
final
Widget
result
=
builder
(
context
);
assert
(()
{
if
(
result
==
null
)
{
...
...
@@ -164,7 +164,7 @@ class MaterialPageRoute<T> extends PageRoute<T> {
}
@override
Widget
buildTransitions
(
BuildContext
context
,
Animation
<
double
>
animation
,
Animation
<
double
>
forward
Animation
,
Widget
child
)
{
Widget
buildTransitions
(
BuildContext
context
,
Animation
<
double
>
animation
,
Animation
<
double
>
secondary
Animation
,
Widget
child
)
{
if
(
Theme
.
of
(
context
).
platform
==
TargetPlatform
.
iOS
)
{
if
(
fullscreenDialog
)
return
new
CupertinoFullscreenDialogTransition
(
...
...
@@ -174,7 +174,7 @@ class MaterialPageRoute<T> extends PageRoute<T> {
else
return
new
CupertinoPageTransition
(
incomingRouteAnimation:
animation
,
outgoingRouteAnimation:
forward
Animation
,
outgoingRouteAnimation:
secondary
Animation
,
child:
child
,
// In the middle of a back gesture drag, let the transition be linear to match finger
// motions.
...
...
packages/flutter/lib/src/material/popup_menu.dart
View file @
20e214fa
...
...
@@ -402,7 +402,7 @@ class _PopupMenuRoute<T> extends PopupRoute<T> {
Color
get
barrierColor
=>
null
;
@override
Widget
buildPage
(
BuildContext
context
,
Animation
<
double
>
animation
,
Animation
<
double
>
forward
Animation
)
{
Widget
buildPage
(
BuildContext
context
,
Animation
<
double
>
animation
,
Animation
<
double
>
secondary
Animation
)
{
double
selectedItemOffset
;
if
(
initialValue
!=
null
)
{
selectedItemOffset
=
0.0
;
...
...
packages/flutter/lib/src/widgets/pages.dart
View file @
20e214fa
...
...
@@ -46,15 +46,15 @@ abstract class PageRoute<T> extends ModalRoute<T> {
/// primary contents.
///
/// See [ModalRoute.buildPage] for complete definition of the parameters.
typedef
Widget
RoutePageBuilder
(
BuildContext
context
,
Animation
<
double
>
animation
,
Animation
<
double
>
forward
Animation
);
typedef
Widget
RoutePageBuilder
(
BuildContext
context
,
Animation
<
double
>
animation
,
Animation
<
double
>
secondary
Animation
);
/// Signature for the [PageRouteBuilder] function that builds the route's
/// transitions.
///
/// See [ModalRoute.buildTransitions] for complete definition of the parameters.
typedef
Widget
RouteTransitionsBuilder
(
BuildContext
context
,
Animation
<
double
>
animation
,
Animation
<
double
>
forward
Animation
,
Widget
child
);
typedef
Widget
RouteTransitionsBuilder
(
BuildContext
context
,
Animation
<
double
>
animation
,
Animation
<
double
>
secondary
Animation
,
Widget
child
);
Widget
_defaultTransitionsBuilder
(
BuildContext
context
,
Animation
<
double
>
animation
,
Animation
<
double
>
forward
Animation
,
Widget
child
)
{
Widget
_defaultTransitionsBuilder
(
BuildContext
context
,
Animation
<
double
>
animation
,
Animation
<
double
>
secondary
Animation
,
Widget
child
)
{
return
child
;
}
...
...
@@ -110,13 +110,13 @@ class PageRouteBuilder<T> extends PageRoute<T> {
final
bool
maintainState
;
@override
Widget
buildPage
(
BuildContext
context
,
Animation
<
double
>
animation
,
Animation
<
double
>
forward
Animation
)
{
return
pageBuilder
(
context
,
animation
,
forward
Animation
);
Widget
buildPage
(
BuildContext
context
,
Animation
<
double
>
animation
,
Animation
<
double
>
secondary
Animation
)
{
return
pageBuilder
(
context
,
animation
,
secondary
Animation
);
}
@override
Widget
buildTransitions
(
BuildContext
context
,
Animation
<
double
>
animation
,
Animation
<
double
>
forward
Animation
,
Widget
child
)
{
return
transitionsBuilder
(
context
,
animation
,
forward
Animation
,
child
);
Widget
buildTransitions
(
BuildContext
context
,
Animation
<
double
>
animation
,
Animation
<
double
>
secondary
Animation
,
Widget
child
)
{
return
transitionsBuilder
(
context
,
animation
,
secondary
Animation
,
child
);
}
}
packages/flutter/lib/src/widgets/routes.dart
View file @
20e214fa
This diff is collapsed.
Click to expand it.
packages/flutter/test/widgets/app_overrides_test.dart
View file @
20e214fa
...
...
@@ -20,7 +20,7 @@ class TestRoute<T> extends PageRoute<T> {
bool
get
maintainState
=>
false
;
@override
Widget
buildPage
(
BuildContext
context
,
Animation
<
double
>
animation
,
Animation
<
double
>
forward
Animation
)
{
Widget
buildPage
(
BuildContext
context
,
Animation
<
double
>
animation
,
Animation
<
double
>
secondary
Animation
)
{
return
child
;
}
}
...
...
packages/flutter/test/widgets/page_forward_transitions_test.dart
View file @
20e214fa
...
...
@@ -41,7 +41,7 @@ class TestRoute<T> extends PageRoute<T> {
bool
get
maintainState
=>
false
;
@override
Widget
buildPage
(
BuildContext
context
,
Animation
<
double
>
animation
,
Animation
<
double
>
forward
Animation
)
{
Widget
buildPage
(
BuildContext
context
,
Animation
<
double
>
animation
,
Animation
<
double
>
secondary
Animation
)
{
return
child
;
}
}
...
...
@@ -94,7 +94,7 @@ void main() {
new
TestTransition
(
childFirstHalf:
new
Text
(
'C'
),
childSecondHalf:
new
Text
(
'D'
),
animation:
route
.
forward
Animation
animation:
route
.
secondary
Animation
),
]
);
...
...
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