Skip to content

Commit 3b16b48

Browse files
yjbanovblasten
authored andcommitted
remove Layer.replaceWith due to no usage and no tests (flutter#33164)
1 parent 029dd2e commit 3b16b48

File tree

1 file changed

+0
-33
lines changed

1 file changed

+0
-33
lines changed

packages/flutter/lib/src/rendering/layer.dart

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -125,39 +125,6 @@ abstract class Layer extends AbstractNode with DiagnosticableTreeMixin {
125125
parent?._removeChild(this);
126126
}
127127

128-
/// Replaces this layer with the given layer in the parent layer's child list.
129-
void replaceWith(Layer newLayer) {
130-
assert(parent != null);
131-
assert(attached == parent.attached);
132-
assert(newLayer.parent == null);
133-
assert(newLayer._nextSibling == null);
134-
assert(newLayer._previousSibling == null);
135-
assert(!newLayer.attached);
136-
newLayer._nextSibling = nextSibling;
137-
if (_nextSibling != null)
138-
_nextSibling._previousSibling = newLayer;
139-
newLayer._previousSibling = previousSibling;
140-
if (_previousSibling != null)
141-
_previousSibling._nextSibling = newLayer;
142-
assert(() {
143-
Layer node = this;
144-
while (node.parent != null)
145-
node = node.parent;
146-
assert(node != newLayer); // indicates we are about to create a cycle
147-
return true;
148-
}());
149-
parent.adoptChild(newLayer);
150-
assert(newLayer.attached == parent.attached);
151-
if (parent.firstChild == this)
152-
parent._firstChild = newLayer;
153-
if (parent.lastChild == this)
154-
parent._lastChild = newLayer;
155-
_nextSibling = null;
156-
_previousSibling = null;
157-
parent.dropChild(this);
158-
assert(!attached);
159-
}
160-
161128
/// Returns the value of [S] that corresponds to the point described by
162129
/// [regionOffset].
163130
///

0 commit comments

Comments
 (0)