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
5de9b52b
Commit
5de9b52b
authored
Aug 20, 2015
by
Adam Barth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename Component._built to Component._child
Rationalizes this name with walkChildren.
parent
2db1f59c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
26 deletions
+26
-26
framework.dart
packages/flutter/lib/widgets/framework.dart
+26
-26
No files found.
packages/flutter/lib/widgets/framework.dart
View file @
5de9b52b
...
...
@@ -585,31 +585,31 @@ abstract class Component extends Widget {
bool
_dirty
=
true
;
Widget
_
built
;
Widget
_
child
;
dynamic
_slot
;
// cached slot from the last time we were synced
void
updateSlot
(
dynamic
newSlot
)
{
_slot
=
newSlot
;
if
(
_
built
!=
null
)
_
built
.
updateSlot
(
newSlot
);
if
(
_
child
!=
null
)
_
child
.
updateSlot
(
newSlot
);
}
void
walkChildren
(
WidgetTreeWalker
walker
)
{
if
(
_
built
!=
null
)
walker
(
_
built
);
if
(
_
child
!=
null
)
walker
(
_
child
);
}
void
remove
()
{
assert
(
_
built
!=
null
);
assert
(
_
child
!=
null
);
assert
(
renderObject
!=
null
);
super
.
remove
();
_
built
=
null
;
_
child
=
null
;
}
void
detachRenderObject
()
{
assert
(
_
built
!=
null
);
assert
(
_
child
!=
null
);
assert
(
renderObject
!=
null
);
_
built
.
detachRenderObject
();
_
child
.
detachRenderObject
();
}
void
dependenciesChanged
()
{
...
...
@@ -627,38 +627,38 @@ abstract class Component extends Widget {
// There are three cases here:
// 1) Building for the first time:
// assert(_
built
== null && old == null)
// assert(_
child
== null && old == null)
// 2) Re-building (because a dirty flag got set):
// assert(_
built
!= null && old == null)
// assert(_
child
!= null && old == null)
// 3) Syncing against an old version
// assert(_
built
== null && old != null)
// assert(_
child
== null && old != null)
void
_sync
(
Component
old
,
dynamic
slot
)
{
assert
(
_
built
==
null
||
old
==
null
);
assert
(
_
child
==
null
||
old
==
null
);
updateSlot
(
slot
);
var
oldBuilt
;
Widget
oldChild
;
if
(
old
==
null
)
{
old
Built
=
_built
;
old
Child
=
_child
;
}
else
{
assert
(
_
built
==
null
);
old
Built
=
old
.
_built
;
assert
(
_
child
==
null
);
old
Child
=
old
.
_child
;
}
_isBuilding
=
true
;
int
lastOrder
=
_currentOrder
;
_currentOrder
=
_order
;
_
built
=
build
();
_
child
=
build
();
_currentOrder
=
lastOrder
;
assert
(
_
built
!=
null
);
_
built
=
syncChild
(
_built
,
oldBuilt
,
slot
);
assert
(
_
built
!=
null
);
assert
(
_
built
.
parent
==
this
);
assert
(
_
child
!=
null
);
_
child
=
syncChild
(
_child
,
oldChild
,
slot
);
assert
(
_
child
!=
null
);
assert
(
_
child
.
parent
==
this
);
_isBuilding
=
false
;
_dirty
=
false
;
_renderObject
=
_
built
.
renderObject
;
_renderObject
=
_
child
.
renderObject
;
assert
(
_renderObject
==
renderObject
);
// in case a subclass reintroduces it
assert
(
renderObject
!=
null
);
}
...
...
@@ -709,11 +709,11 @@ abstract class StatefulComponent extends Component {
assert
(
newNode
!=
null
);
assert
(
runtimeType
==
newNode
.
runtimeType
);
assert
(
key
==
newNode
.
key
);
assert
(
_
built
!=
null
);
assert
(
_
child
!=
null
);
newNode
.
_disqualifiedFromEverAppearingAgain
=
true
;
newNode
.
_
built
=
_built
;
_
built
=
null
;
newNode
.
_
child
=
_child
;
_
child
=
null
;
_dirty
=
true
;
return
true
;
...
...
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