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
a54f7cf2
Commit
a54f7cf2
authored
Jul 17, 2015
by
Collin Jackson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug when having more than 2 routes
parent
e075988f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
navigator.dart
packages/flutter/lib/widgets/navigator.dart
+10
-2
No files found.
packages/flutter/lib/widgets/navigator.dart
View file @
a54f7cf2
...
@@ -46,7 +46,13 @@ const Duration _kTransitionDuration = const Duration(milliseconds: 200);
...
@@ -46,7 +46,13 @@ const Duration _kTransitionDuration = const Duration(milliseconds: 200);
const
Point
_kTransitionStartPoint
=
const
Point
(
0.0
,
100.0
);
const
Point
_kTransitionStartPoint
=
const
Point
(
0.0
,
100.0
);
enum
TransitionDirection
{
forward
,
reverse
}
enum
TransitionDirection
{
forward
,
reverse
}
class
Transition
extends
AnimatedComponent
{
class
Transition
extends
AnimatedComponent
{
Transition
({
this
.
content
,
this
.
direction
,
this
.
onDismissed
,
this
.
interactive
});
Transition
({
String
key
,
this
.
content
,
this
.
direction
,
this
.
onDismissed
,
this
.
interactive
})
:
super
(
key:
key
);
Widget
content
;
Widget
content
;
TransitionDirection
direction
;
TransitionDirection
direction
;
bool
interactive
;
bool
interactive
;
...
@@ -206,6 +212,7 @@ class Navigator extends StatefulComponent {
...
@@ -206,6 +212,7 @@ class Navigator extends StatefulComponent {
Widget
build
()
{
Widget
build
()
{
List
<
Widget
>
visibleRoutes
=
new
List
<
Widget
>();
List
<
Widget
>
visibleRoutes
=
new
List
<
Widget
>();
for
(
int
i
=
0
;
i
<
state
.
history
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
state
.
history
.
length
;
i
++)
{
// TODO(jackson): Avoid building routes that are not visible
HistoryEntry
historyEntry
=
state
.
history
[
i
];
HistoryEntry
historyEntry
=
state
.
history
[
i
];
Widget
content
=
historyEntry
.
route
.
build
(
this
,
historyEntry
.
route
);
Widget
content
=
historyEntry
.
route
.
build
(
this
,
historyEntry
.
route
);
if
(
i
==
0
)
{
if
(
i
==
0
)
{
...
@@ -214,7 +221,8 @@ class Navigator extends StatefulComponent {
...
@@ -214,7 +221,8 @@ class Navigator extends StatefulComponent {
}
}
if
(
content
==
null
)
if
(
content
==
null
)
continue
;
continue
;
Transition
transition
=
new
Transition
(
content:
content
)
String
key
=
historyEntry
.
route
.
key
;
Transition
transition
=
new
Transition
(
content:
content
,
key:
key
)
..
direction
=
(
i
<=
state
.
historyIndex
)
?
TransitionDirection
.
forward
:
TransitionDirection
.
reverse
..
direction
=
(
i
<=
state
.
historyIndex
)
?
TransitionDirection
.
forward
:
TransitionDirection
.
reverse
..
interactive
=
(
i
==
state
.
historyIndex
)
..
interactive
=
(
i
==
state
.
historyIndex
)
..
onDismissed
=
()
{
..
onDismissed
=
()
{
...
...
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