Index: sky/sdk/lib/widgets/scaffold.dart |
diff --git a/sky/sdk/lib/widgets/scaffold.dart b/sky/sdk/lib/widgets/scaffold.dart |
index 8d6c4f2443189e9e5c38a810d8eafc754164686d..b98b3beef49f8c623419544d659764bae7198d25 100644 |
--- a/sky/sdk/lib/widgets/scaffold.dart |
+++ b/sky/sdk/lib/widgets/scaffold.dart |
@@ -181,6 +181,19 @@ class Scaffold extends RenderObjectWrapper { |
RenderScaffold get root => super.root; |
RenderScaffold createNode() => new RenderScaffold(); |
+ void walkChildren(WidgetTreeWalker walker) { |
+ if (_toolbar != null) |
+ walker(_toolbar); |
+ if (_body != null) |
+ walker(_body); |
+ if (_statusBar != null) |
+ walker(_statusBar); |
+ if (_drawer != null) |
+ walker(_drawer); |
+ if (_floatingActionButton != null) |
+ walker(_floatingActionButton); |
+ } |
+ |
void insertChildRoot(RenderObjectWrapper child, ScaffoldSlots slot) { |
root[slot] = child != null ? child.root : null; |
} |
@@ -194,16 +207,7 @@ class Scaffold extends RenderObjectWrapper { |
} |
void remove() { |
- if (_toolbar != null) |
- removeChild(_toolbar); |
- if (_body != null) |
- removeChild(_body); |
- if (_statusBar != null) |
- removeChild(_statusBar); |
- if (_drawer != null) |
- removeChild(_drawer); |
- if (_floatingActionButton != null) |
- removeChild(_floatingActionButton); |
+ walkChildren((Widget child) => removeChild(child)); |
super.remove(); |
} |