Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit a9195e3

Browse files
committed
Rename Component._built to Component._child
Rationalizes this name with walkChildren.
1 parent f2faa74 commit a9195e3

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

sky/packages/sky/lib/widgets/framework.dart

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -585,31 +585,31 @@ abstract class Component extends Widget {
585585

586586
bool _dirty = true;
587587

588-
Widget _built;
588+
Widget _child;
589589
dynamic _slot; // cached slot from the last time we were synced
590590

591591
void updateSlot(dynamic newSlot) {
592592
_slot = newSlot;
593-
if (_built != null)
594-
_built.updateSlot(newSlot);
593+
if (_child != null)
594+
_child.updateSlot(newSlot);
595595
}
596596

597597
void walkChildren(WidgetTreeWalker walker) {
598-
if (_built != null)
599-
walker(_built);
598+
if (_child != null)
599+
walker(_child);
600600
}
601601

602602
void remove() {
603-
assert(_built != null);
603+
assert(_child != null);
604604
assert(renderObject != null);
605605
super.remove();
606-
_built = null;
606+
_child = null;
607607
}
608608

609609
void detachRenderObject() {
610-
assert(_built != null);
610+
assert(_child != null);
611611
assert(renderObject != null);
612-
_built.detachRenderObject();
612+
_child.detachRenderObject();
613613
}
614614

615615
void dependenciesChanged() {
@@ -627,38 +627,38 @@ abstract class Component extends Widget {
627627

628628
// There are three cases here:
629629
// 1) Building for the first time:
630-
// assert(_built == null && old == null)
630+
// assert(_child == null && old == null)
631631
// 2) Re-building (because a dirty flag got set):
632-
// assert(_built != null && old == null)
632+
// assert(_child != null && old == null)
633633
// 3) Syncing against an old version
634-
// assert(_built == null && old != null)
634+
// assert(_child == null && old != null)
635635
void _sync(Component old, dynamic slot) {
636-
assert(_built == null || old == null);
636+
assert(_child == null || old == null);
637637

638638
updateSlot(slot);
639639

640-
var oldBuilt;
640+
Widget oldChild;
641641
if (old == null) {
642-
oldBuilt = _built;
642+
oldChild = _child;
643643
} else {
644-
assert(_built == null);
645-
oldBuilt = old._built;
644+
assert(_child == null);
645+
oldChild = old._child;
646646
}
647647

648648
_isBuilding = true;
649649

650650
int lastOrder = _currentOrder;
651651
_currentOrder = _order;
652-
_built = build();
652+
_child = build();
653653
_currentOrder = lastOrder;
654-
assert(_built != null);
655-
_built = syncChild(_built, oldBuilt, slot);
656-
assert(_built != null);
657-
assert(_built.parent == this);
654+
assert(_child != null);
655+
_child = syncChild(_child, oldChild, slot);
656+
assert(_child != null);
657+
assert(_child.parent == this);
658658
_isBuilding = false;
659659

660660
_dirty = false;
661-
_renderObject = _built.renderObject;
661+
_renderObject = _child.renderObject;
662662
assert(_renderObject == renderObject); // in case a subclass reintroduces it
663663
assert(renderObject != null);
664664
}
@@ -709,11 +709,11 @@ abstract class StatefulComponent extends Component {
709709
assert(newNode != null);
710710
assert(runtimeType == newNode.runtimeType);
711711
assert(key == newNode.key);
712-
assert(_built != null);
712+
assert(_child != null);
713713
newNode._disqualifiedFromEverAppearingAgain = true;
714714

715-
newNode._built = _built;
716-
_built = null;
715+
newNode._child = _child;
716+
_child = null;
717717
_dirty = true;
718718

719719
return true;

0 commit comments

Comments
 (0)