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

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

Issue 1204523002: Material light and dark themes for Sky widgets (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: fix analyzer warning properly 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/switch.dart ('k') | sky/sdk/lib/widgets/tool_bar.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/widgets/theme.dart
diff --git a/sky/sdk/lib/widgets/theme.dart b/sky/sdk/lib/widgets/theme.dart
index 09f3d0800f4c19b00d0e87e0adaf3dde9da92d8d..f2ef760d7581a2b56efc2ba816d3dbc1ceda4fda 100644
--- a/sky/sdk/lib/widgets/theme.dart
+++ b/sky/sdk/lib/widgets/theme.dart
@@ -19,10 +19,10 @@ class Theme extends Inherited {
final ThemeData data;
+ static ThemeData _kFallbackTheme = new ThemeData.fallback();
abarth-chromium 2015/06/23 02:11:36 final
jackson 2015/06/23 17:14:09 Fixed in https://codereview.chromium.org/119277300
+
static ThemeData of(Component component) {
Theme theme = component.inheritedOfType(Theme);
- // If you hit this assert, you need to wrap your Component in a Theme
- assert(theme != null);
- return theme.data;
+ return theme == null ? _kFallbackTheme : theme.data;
}
}
« no previous file with comments | « sky/sdk/lib/widgets/switch.dart ('k') | sky/sdk/lib/widgets/tool_bar.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698