mirror of
https://github.com/flutter/flutter
synced 2024-10-13 11:42:54 +00:00
remove Layer.replaceWith due to no usage and no tests (#33164)
This commit is contained in:
parent
20c31e7ac3
commit
8217f4bc8c
|
@ -125,39 +125,6 @@ abstract class Layer extends AbstractNode with DiagnosticableTreeMixin {
|
|||
parent?._removeChild(this);
|
||||
}
|
||||
|
||||
/// Replaces this layer with the given layer in the parent layer's child list.
|
||||
void replaceWith(Layer newLayer) {
|
||||
assert(parent != null);
|
||||
assert(attached == parent.attached);
|
||||
assert(newLayer.parent == null);
|
||||
assert(newLayer._nextSibling == null);
|
||||
assert(newLayer._previousSibling == null);
|
||||
assert(!newLayer.attached);
|
||||
newLayer._nextSibling = nextSibling;
|
||||
if (_nextSibling != null)
|
||||
_nextSibling._previousSibling = newLayer;
|
||||
newLayer._previousSibling = previousSibling;
|
||||
if (_previousSibling != null)
|
||||
_previousSibling._nextSibling = newLayer;
|
||||
assert(() {
|
||||
Layer node = this;
|
||||
while (node.parent != null)
|
||||
node = node.parent;
|
||||
assert(node != newLayer); // indicates we are about to create a cycle
|
||||
return true;
|
||||
}());
|
||||
parent.adoptChild(newLayer);
|
||||
assert(newLayer.attached == parent.attached);
|
||||
if (parent.firstChild == this)
|
||||
parent._firstChild = newLayer;
|
||||
if (parent.lastChild == this)
|
||||
parent._lastChild = newLayer;
|
||||
_nextSibling = null;
|
||||
_previousSibling = null;
|
||||
parent.dropChild(this);
|
||||
assert(!attached);
|
||||
}
|
||||
|
||||
/// Returns the value of [S] that corresponds to the point described by
|
||||
/// [regionOffset].
|
||||
///
|
||||
|
|
Loading…
Reference in a new issue