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

Unified Diff: sky/sdk/lib/framework/fn2.dart

Issue 1151573020: Fix the crash when the drawer is hidden. (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 | « sky/sdk/lib/framework/components2/scaffold.dart ('k') | sky/sdk/lib/framework/rendering/node.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/framework/fn2.dart
diff --git a/sky/sdk/lib/framework/fn2.dart b/sky/sdk/lib/framework/fn2.dart
index 77fde9afa1620bbc00a1f983ab1d583d09d34f08..a3adb268742274348a5a80bfed9a3dc4e059476b 100644
--- a/sky/sdk/lib/framework/fn2.dart
+++ b/sky/sdk/lib/framework/fn2.dart
@@ -317,11 +317,6 @@ abstract class RenderNodeWrapper extends UINode {
}
}
- void removeChild(UINode node) {
- root.remove(node.root);
- super.removeChild(node);
- }
-
void _remove() {
assert(root != null);
_nodeMap.remove(root);
@@ -334,20 +329,25 @@ abstract class OneChildRenderNodeWrapper extends RenderNodeWrapper {
OneChildRenderNodeWrapper({ this.child, Object key }) : super(key: key);
+ void syncRenderNode(RenderNodeWrapper old) {
+ super.syncRenderNode(old);
+ UINode oldChild = old == null ? null : (old as OneChildRenderNodeWrapper).child;
+ syncChild(child, oldChild, null);
+ }
+
void insert(RenderNodeWrapper child, dynamic slot) {
assert(slot == null);
root.child = child.root;
}
- void syncRenderNode(RenderNodeWrapper old) {
- super.syncRenderNode(old);
- UINode oldChild = old == null ? null : (old as OneChildRenderNodeWrapper).child;
- syncChild(child, oldChild, null);
+ void removeChild(UINode node) {
+ root.child = null;
+ super.removeChild(node);
}
void _remove() {
- assert(child != null);
- removeChild(child);
+ if (child != null)
+ removeChild(child);
super._remove();
}
}
@@ -436,6 +436,12 @@ abstract class OneChildListRenderNodeWrapper extends RenderNodeWrapper {
root.add(child.root, before: slot);
}
+ void removeChild(UINode node) {
+ assert(root is ContainerRenderNodeMixin);
+ root.remove(node.root);
+ super.removeChild(node);
+ }
+
void _remove() {
assert(children != null);
for (var child in children) {
« no previous file with comments | « sky/sdk/lib/framework/components2/scaffold.dart ('k') | sky/sdk/lib/framework/rendering/node.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698