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
8915cf0b
Commit
8915cf0b
authored
Oct 09, 2015
by
Hixie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid painting previous routes redundantly
...once the animation is done.
parent
dfc7f00a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
navigator.dart
packages/flutter/lib/src/widgets/navigator.dart
+13
-3
No files found.
packages/flutter/lib/src/widgets/navigator.dart
View file @
8915cf0b
...
...
@@ -112,6 +112,16 @@ class NavigatorState extends State<Navigator> {
return
index
>=
0
&&
index
<=
_currentPosition
;
}
void
_didCompleteRoute
(
Route
route
)
{
assert
(
_history
.
contains
(
route
));
if
(
route
.
isActuallyOpaque
)
{
setState
(()
{
// we need to rebuild because our build function depends on
// whether the route is opaque or not.
});
}
}
void
_didDismissRoute
(
Route
route
)
{
assert
(
_history
.
contains
(
route
));
if
(
_history
.
lastIndexOf
(
route
)
<=
_currentPosition
)
...
...
@@ -240,7 +250,9 @@ abstract class Route {
}
void
_handlePerformanceStatusChanged
(
PerformanceStatus
status
)
{
if
(
status
==
PerformanceStatus
.
dismissed
)
{
if
(
status
==
PerformanceStatus
.
completed
)
{
_navigator
.
_didCompleteRoute
(
this
);
}
else
if
(
status
==
PerformanceStatus
.
dismissed
)
{
_navigator
.
_didDismissRoute
(
this
);
_navigator
.
_removeRoute
(
this
);
_navigator
=
null
;
...
...
@@ -266,8 +278,6 @@ abstract class PerformanceRoute extends Route {
Duration
get
transitionDuration
;
bool
get
isActuallyOpaque
=>
(
performance
==
null
||
_performance
.
isCompleted
)
&&
opaque
;
Widget
build
(
NavigatorState
navigator
,
PerformanceView
nextRoutePerformance
);
void
didPush
(
NavigatorState
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