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

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

Issue 1194743003: Add a new Theme widget to control color and text color of apps (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: rebase 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/widgets/checkbox.dart ('k') | sky/sdk/lib/widgets/theme.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 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();
}
« no previous file with comments | « sky/sdk/lib/widgets/checkbox.dart ('k') | sky/sdk/lib/widgets/theme.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698