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

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

Issue 1235443002: Support for icon theming (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: fix analyzer warning Created 5 years, 5 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/theme/colors.dart ('k') | sky/sdk/lib/widgets/floating_action_button.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 be7652afaba4b15c77df09a3d9f1ad05b4a32d2e..288372e8797493b465c3d5e1b76e3ccc8486aa57 100644
--- a/sky/sdk/lib/theme/theme_data.dart
+++ b/sky/sdk/lib/theme/theme_data.dart
@@ -15,11 +15,11 @@ class ThemeData {
ThemeBrightness brightness,
Map<int, Color> primarySwatch,
Color accentColor,
- Color floatingActionButtonColor,
- typography.TextTheme text,
- typography.TextTheme toolbarText })
+ this.accentColorBrightness: ThemeBrightness.dark,
+ typography.TextTheme text })
: this.brightness = brightness,
this.primarySwatch = primarySwatch,
+ primaryColorBrightness = primarySwatch == null ? brightness : ThemeBrightness.dark,
canvasColor = brightness == ThemeBrightness.dark ? colors.Grey[850] : colors.Grey[50],
cardColor = brightness == ThemeBrightness.dark ? colors.Grey[800] : colors.White,
dividerColor = brightness == ThemeBrightness.dark ? const Color(0x1FFFFFFF) : const Color(0x1F000000),
@@ -27,31 +27,20 @@ class ThemeData {
assert(brightness != null);
if (primarySwatch == null) {
- _primaryColor = brightness == ThemeBrightness.dark ? colors.Grey[900] : colors.Grey[100];
+ if (brightness == ThemeBrightness.dark) {
+ _primaryColor = colors.Grey[900];
+ } else {
+ _primaryColor = colors.Grey[100];
+ }
} else {
_primaryColor = primarySwatch[500];
}
-
+
if (accentColor == null) {
_accentColor = primarySwatch == null ? colors.Blue[500] : primarySwatch[500];
} else {
_accentColor = accentColor;
}
-
- if (floatingActionButtonColor == null) {
- _floatingActionButtonColor = accentColor == null ? colors.PinkAccent[200] : accentColor;
- } else {
- _floatingActionButtonColor = floatingActionButtonColor;
- }
-
- if (toolbarText == null) {
- if (colors.DarkColors.contains(primarySwatch) || _primaryColor == colors.Grey[900])
- _toolbarText = typography.white;
- else
- _toolbarText = typography.black;
- } else {
- _toolbarText = toolbarText;
- }
}
factory ThemeData.light() => new ThemeData(primarySwatch: colors.Blue, brightness: ThemeBrightness.light);
@@ -68,12 +57,10 @@ class ThemeData {
Color _primaryColor;
Color get primaryColor => _primaryColor;
+ final ThemeBrightness primaryColorBrightness;
+
Color _accentColor;
Color get accentColor => _accentColor;
- Color _floatingActionButtonColor;
- Color get floatingActionButtonColor => _floatingActionButtonColor;
-
- typography.TextTheme _toolbarText;
- typography.TextTheme get toolbarText => _toolbarText;
+ final ThemeBrightness accentColorBrightness;
}
« no previous file with comments | « sky/sdk/lib/theme/colors.dart ('k') | sky/sdk/lib/widgets/floating_action_button.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698