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
ab8aeff8
Commit
ab8aeff8
authored
Oct 01, 2015
by
Ian Hickson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1439 from Hixie/heroes1
Heroes: Pass next Performance to route builders
parents
434a36be
8cce992f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
16 deletions
+31
-16
basic.dart
packages/flutter/lib/src/widgets/basic.dart
+12
-0
dialog.dart
packages/flutter/lib/src/widgets/dialog.dart
+1
-1
drag_target.dart
packages/flutter/lib/src/widgets/drag_target.dart
+4
-3
navigator.dart
packages/flutter/lib/src/widgets/navigator.dart
+11
-8
popup_menu.dart
packages/flutter/lib/src/widgets/popup_menu.dart
+3
-4
No files found.
packages/flutter/lib/src/widgets/basic.dart
View file @
ab8aeff8
...
...
@@ -899,6 +899,9 @@ class IgnorePointer extends OneChildRenderObjectWidget {
}
}
// UTILITY NODES
class
MetaData
extends
OneChildRenderObjectWidget
{
MetaData
({
Key
key
,
Widget
child
,
this
.
metaData
})
:
super
(
key:
key
,
child:
child
);
...
...
@@ -911,3 +914,12 @@ class MetaData extends OneChildRenderObjectWidget {
renderObject
.
metaData
=
metaData
;
}
}
class
KeyedSubtree
extends
StatelessComponent
{
KeyedSubtree
({
Key
key
,
this
.
child
})
:
super
(
key:
key
);
final
Widget
child
;
Widget
build
(
BuildContext
context
)
=>
child
;
}
\ No newline at end of file
packages/flutter/lib/src/widgets/dialog.dart
View file @
ab8aeff8
...
...
@@ -140,7 +140,7 @@ class DialogRoute extends Route {
Duration
get
transitionDuration
=>
_kTransitionDuration
;
bool
get
opaque
=>
false
;
Widget
build
(
Key
key
,
NavigatorState
navigator
)
{
Widget
build
(
NavigatorState
navigator
,
WatchableAnimationPerformance
nextRoutePerformance
)
{
return
new
FadeTransition
(
performance:
performance
,
opacity:
new
AnimatedValue
<
double
>(
0.0
,
end:
1.0
,
curve:
easeOut
),
...
...
packages/flutter/lib/src/widgets/drag_target.dart
View file @
ab8aeff8
...
...
@@ -5,6 +5,7 @@
import
'dart:collection'
;
import
'dart:sky'
as
sky
;
import
'package:sky/animation.dart'
;
import
'package:sky/rendering.dart'
;
import
'package:sky/src/widgets/basic.dart'
;
import
'package:sky/src/widgets/binding.dart'
;
...
...
@@ -199,10 +200,10 @@ class DragRoute extends Route {
bool
get
ephemeral
=>
true
;
bool
get
modal
=>
false
;
Duration
get
transitionDuration
=>
const
Duration
();
bool
get
opaque
=>
false
;
Widget
build
(
Key
key
,
NavigatorState
navigator
)
{
Duration
get
transitionDuration
=>
const
Duration
();
Widget
build
(
NavigatorState
navigator
,
WatchableAnimationPerformance
nextRoutePerformance
)
{
return
new
Positioned
(
left:
_lastOffset
.
dx
,
top:
_lastOffset
.
dy
,
...
...
packages/flutter/lib/src/widgets/navigator.dart
View file @
ab8aeff8
...
...
@@ -118,6 +118,7 @@ class NavigatorState extends State<Navigator> {
Widget
build
(
BuildContext
context
)
{
List
<
Widget
>
visibleRoutes
=
new
List
<
Widget
>();
bool
alreadyInsertModalBarrier
=
false
;
WatchableAnimationPerformance
nextPerformance
;
for
(
int
i
=
_history
.
length
-
1
;
i
>=
0
;
i
-=
1
)
{
Route
route
=
_history
[
i
];
if
(!
route
.
hasContent
)
{
...
...
@@ -133,9 +134,12 @@ class NavigatorState extends State<Navigator> {
_history
.
remove
(
route
);
});
};
Key
key
=
new
ObjectKey
(
route
);
Widget
widget
=
route
.
build
(
key
,
this
);
visibleRoutes
.
add
(
widget
);
visibleRoutes
.
add
(
new
KeyedSubtree
(
key:
new
ObjectKey
(
route
),
child:
route
.
build
(
this
,
nextPerformance
)
)
);
if
(
route
.
isActuallyOpaque
)
break
;
assert
(
route
.
modal
||
route
.
ephemeral
);
...
...
@@ -146,6 +150,7 @@ class NavigatorState extends State<Navigator> {
));
alreadyInsertModalBarrier
=
true
;
}
nextPerformance
=
route
.
performance
;
}
return
new
Focus
(
child:
new
Stack
(
visibleRoutes
.
reversed
.
toList
()));
}
...
...
@@ -238,7 +243,7 @@ abstract class Route {
bool
get
isActuallyOpaque
=>
(
performance
==
null
||
_performance
.
isCompleted
)
&&
opaque
;
Widget
build
(
Key
key
,
NavigatorState
navigator
);
Widget
build
(
NavigatorState
navigator
,
WatchableAnimationPerformance
nextRoutePerformance
);
void
didPop
([
dynamic
result
])
{
if
(
performance
==
null
&&
_onDismissed
!=
null
)
_onDismissed
();
...
...
@@ -256,14 +261,12 @@ class PageRoute extends Route {
final
RouteBuilder
builder
;
bool
get
opaque
=>
true
;
Duration
get
transitionDuration
=>
_kTransitionDuration
;
Widget
build
(
Key
key
,
NavigatorState
navigator
)
{
Widget
build
(
NavigatorState
navigator
,
WatchableAnimationPerformance
nextRoutePerformance
)
{
// TODO(jackson): Hit testing should ignore transform
// TODO(jackson): Block input unless content is interactive
return
new
SlideTransition
(
key:
key
,
performance:
performance
,
position:
new
AnimatedValue
<
Point
>(
_kTransitionStartPoint
,
end:
Point
.
origin
,
curve:
easeOut
),
child:
new
FadeTransition
(
...
...
@@ -293,5 +296,5 @@ class StateRoute extends Route {
super
.
didPop
(
result
);
}
Widget
build
(
Key
key
,
NavigatorState
navigator
)
=>
null
;
Widget
build
(
NavigatorState
navigator
,
WatchableAnimationPerformance
nextRoutePerformance
)
=>
null
;
}
packages/flutter/lib/src/widgets/popup_menu.dart
View file @
ab8aeff8
...
...
@@ -169,10 +169,10 @@ class MenuRoute extends Route {
bool
get
ephemeral
=>
false
;
// we could make this true, but then we'd have to use popRoute(), not pop(), in menus
bool
get
modal
=>
true
;
Duration
get
transitionDuration
=>
_kMenuDuration
;
bool
get
opaque
=>
false
;
Widget
build
(
Key
key
,
NavigatorState
navigator
)
{
Duration
get
transitionDuration
=>
_kMenuDuration
;
Widget
build
(
NavigatorState
navigator
,
WatchableAnimationPerformance
nextRoutePerformance
)
{
return
new
Positioned
(
top:
position
?.
top
,
right:
position
?.
right
,
...
...
@@ -182,7 +182,6 @@ class MenuRoute extends Route {
key:
new
GlobalObjectKey
(
this
),
autofocus:
true
,
child:
new
PopupMenu
(
key:
key
,
items:
builder
!=
null
?
builder
(
navigator
)
:
const
<
PopupMenuItem
>[],
level:
level
,
navigator:
navigator
,
...
...
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