Unverified Commit 2dc71a34 authored by chunhtai's avatar chunhtai Committed by GitHub

reland Refactors global key duplication detection (#49896)

* reland "Refactors global key duplication detection (#46183)"

This reverts commit d2b66dbf.

* fix test
parent 2c51efef
......@@ -469,6 +469,7 @@ class _CupertinoAlertRenderElement extends RenderObjectElement {
} else if (_actionsElement == child) {
_actionsElement = null;
}
super.forgetChild(child);
}
@override
......
......@@ -464,6 +464,7 @@ class _CupertinoDialogRenderElement extends RenderObjectElement {
assert(_actionsElement == child);
_actionsElement = null;
}
super.forgetChild(child);
}
@override
......
......@@ -2072,6 +2072,7 @@ class _RenderChipElement extends RenderObjectElement {
final _ChipSlot slot = childToSlot[child];
childToSlot.remove(child);
slotToChild.remove(slot);
super.forgetChild(child);
}
void _mountChild(Widget widget, _ChipSlot slot) {
......
......@@ -1511,6 +1511,7 @@ class _RenderDecorationElement extends RenderObjectElement {
final _DecorationSlot slot = childToSlot[child];
childToSlot.remove(child);
slotToChild.remove(slot);
super.forgetChild(child);
}
void _mountChild(Widget widget, _DecorationSlot slot) {
......
......@@ -992,6 +992,7 @@ class _ListTileElement extends RenderObjectElement {
final _ListTileSlot slot = childToSlot[child];
childToSlot.remove(child);
slotToChild.remove(slot);
super.forgetChild(child);
}
void _mountChild(Widget widget, _ListTileSlot slot) {
......
......@@ -1016,6 +1016,7 @@ class RenderObjectToWidgetElement<T extends RenderObject> extends RootRenderObje
void forgetChild(Element child) {
assert(child == _child);
_child = null;
super.forgetChild(child);
}
@override
......
......@@ -60,6 +60,7 @@ class _LayoutBuilderElement<ConstraintType extends Constraints> extends RenderOb
void forgetChild(Element child) {
assert(child == _child);
_child = null;
super.forgetChild(child);
}
@override
......
......@@ -924,6 +924,7 @@ class ListWheelElement extends RenderObjectElement implements ListWheelChildMana
@override
void forgetChild(Element child) {
_childElements.remove(child.slot);
super.forgetChild(child);
}
}
......
......@@ -1160,6 +1160,7 @@ class SliverMultiBoxAdaptorElement extends RenderObjectElement implements Render
assert(child.slot != null);
assert(_childElements.containsKey(child.slot));
_childElements.remove(child.slot);
super.forgetChild(child);
}
@override
......
......@@ -230,6 +230,7 @@ class _SliverPersistentHeaderElement extends RenderObjectElement {
void forgetChild(Element child) {
assert(child == this.child);
this.child = null;
super.forgetChild(child);
}
@override
......
......@@ -344,6 +344,7 @@ class _TableElement extends RenderObjectElement {
@override
bool forgetChild(Element child) {
_forgottenChildren.add(child);
super.forgetChild(child);
return true;
}
}
......
......@@ -221,11 +221,6 @@ void main() {
class _TestElement extends Element {
_TestElement() : super(const Placeholder());
@override
void forgetChild(Element child) {
// Intentionally left empty.
}
@override
void performRebuild() {
// Intentionally left empty.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment