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

Unified Diff: sky/sdk/lib/theme/theme_data.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
Index: sky/sdk/lib/theme/theme_data.dart
diff --git a/sky/sdk/lib/theme/theme_data.dart b/sky/sdk/lib/theme/theme_data.dart
index f5873978d49ff311f1c059d6dbd377a6f9021b30..7b06afc67ed08ea9eb7aae67ce1fc88ad9511408 100644
--- a/sky/sdk/lib/theme/theme_data.dart
+++ b/sky/sdk/lib/theme/theme_data.dart
@@ -4,10 +4,38 @@
import 'dart:sky';
-import 'typography.dart';
+import 'typography.dart' as typography;
+import 'colors.dart' as colors;
class ThemeData {
- const ThemeData({ this.text, this.color });
- final TextTheme text;
- final Map<int, Color> color;
+
+ ThemeData.light({
+ this.primary,
+ this.accent,
+ bool darkToolbar: false })
+ : toolbarText = darkToolbar ? typography.white : typography.black,
+ text = typography.black,
+ backgroundColor = colors.Grey[50],
+ dialogColor = colors.White;
+
+ ThemeData.dark({ this.primary, this.accent })
+ : toolbarText = typography.white,
+ text = typography.white,
+ backgroundColor = colors.Grey[850],
+ dialogColor = colors.Grey[800];
+
+ ThemeData.fallback()
+ : primary = colors.Indigo,
+ accent = colors.PinkAccent,
+ toolbarText = typography.white,
+ text = typography.black,
+ backgroundColor = colors.Grey[50],
+ dialogColor = colors.White;
+
+ final Map<int, Color> primary;
+ final Map<int, Color> accent;
+ final typography.TextTheme text;
+ final typography.TextTheme toolbarText;
+ final Color backgroundColor;
+ final Color dialogColor;
}

Powered by Google App Engine
This is Rietveld 408576698