protected override void forgetChild(Element child) { D.assert(this.slotToChild.Values.Contains(child)); D.assert(this.childToSlot.Keys.Contains(child)); _ListTileSlot slot = this.childToSlot[child]; this.childToSlot.Remove(child); this.slotToChild.Remove(slot); }
protected override void removeChildRenderObject(RenderObject child) { D.assert(child is RenderBox); D.assert(this.renderObject.childToSlot.Keys.Contains(child)); _ListTileSlot slot = this.renderObject.childToSlot[(RenderBox)child]; this._updateRenderObject(null, slot); D.assert(!this.renderObject.childToSlot.Keys.Contains(child)); D.assert(!this.renderObject.slotToChild.Keys.Contains(slot)); }
protected override void insertChildRenderObject(RenderObject child, object slotValue) { D.assert(child is RenderBox); D.assert(slotValue is _ListTileSlot); _ListTileSlot slot = (_ListTileSlot)slotValue; this._updateRenderObject(child, slot); D.assert(this.renderObject.childToSlot.Keys.Contains(child)); D.assert(this.renderObject.slotToChild.Keys.Contains(slot)); }
public override void forgetChild(Element child) { D.assert(slotToChild.Values.Contains(child)); D.assert(childToSlot.Keys.Contains(child)); _ListTileSlot slot = childToSlot[child]; childToSlot.Remove(child); slotToChild.Remove(slot); base.forgetChild(child); }
void _updateChild(Widget widget, _ListTileSlot slot) { Element oldChild = this.slotToChild.getOrDefault(slot); Element newChild = this.updateChild(oldChild, widget, slot); if (oldChild != null) { this.childToSlot.Remove(oldChild); this.slotToChild.Remove(slot); } if (newChild != null) { this.slotToChild[slot] = newChild; this.childToSlot[newChild] = slot; } }
RenderBox _updateChild(RenderBox oldChild, RenderBox newChild, _ListTileSlot slot) { if (oldChild != null) { this.dropChild(oldChild); this.childToSlot.Remove(oldChild); this.slotToChild.Remove(slot); } if (newChild != null) { this.childToSlot[newChild] = slot; this.slotToChild[slot] = newChild; this.adoptChild(newChild); } return(newChild); }
void _updateRenderObject(RenderObject child, _ListTileSlot slot) { switch (slot) { case _ListTileSlot.leading: this.renderObject.leading = (RenderBox)child; break; case _ListTileSlot.title: this.renderObject.title = (RenderBox)child; break; case _ListTileSlot.subtitle: this.renderObject.subtitle = (RenderBox)child; break; case _ListTileSlot.trailing: this.renderObject.trailing = (RenderBox)child; break; } }