Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(492)

Unified Diff: sky/sdk/lib/widgets/scaffold.dart

Issue 1182463006: Clean up how we remove nodes from the render tree, and make sure we reinsert them in the right plac… (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sky/sdk/lib/widgets/widget.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/widgets/scaffold.dart
diff --git a/sky/sdk/lib/widgets/scaffold.dart b/sky/sdk/lib/widgets/scaffold.dart
index ae750c57358b71cffd0965db5786f4a00bdb27bd..b9b5e508e8415525a7a9b721b573b94ea34610b0 100644
--- a/sky/sdk/lib/widgets/scaffold.dart
+++ b/sky/sdk/lib/widgets/scaffold.dart
@@ -185,10 +185,12 @@ class Scaffold extends RenderObjectWrapper {
root[slot] = child != null ? child.root : null;
}
- void removeChild(Widget node) {
- assert(node != null);
- root.remove(node.root);
- super.removeChild(node);
+ void detachChildRoot(RenderObjectWrapper child) {
+ final root = this.root; // TODO(ianh): Remove this once the analyzer is cleverer
+ assert(root is RenderScaffold);
+ assert(root == child.root.parent);
+ root.remove(child.root);
+ assert(root == this.root); // TODO(ianh): Remove this once the analyzer is cleverer
}
void remove() {
« no previous file with comments | « no previous file | sky/sdk/lib/widgets/widget.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698