@@ -125,39 +125,6 @@ abstract class Layer extends AbstractNode with DiagnosticableTreeMixin {
125
125
parent? ._removeChild (this );
126
126
}
127
127
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
-
161
128
/// Returns the value of [S] that corresponds to the point described by
162
129
/// [regionOffset] .
163
130
///
0 commit comments