| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 import 'dart:sky'; | 5 import 'dart:sky'; |
| 6 | 6 |
| 7 import 'typography.dart' as typography; | 7 import 'typography.dart' as typography; |
| 8 import 'colors.dart' as colors; | 8 import 'colors.dart' as colors; |
| 9 | 9 |
| 10 enum ThemeBrightness { dark, light } |
| 11 |
| 10 class ThemeData { | 12 class ThemeData { |
| 11 | 13 |
| 12 ThemeData.light({ | 14 ThemeData.light({ |
| 13 this.primary, | 15 this.primary, |
| 14 this.accent, | 16 this.accent, |
| 15 bool darkToolbar: false }) | 17 bool darkToolbar: false }) |
| 16 : toolbarText = darkToolbar ? typography.white : typography.black, | 18 : brightness = ThemeBrightness.light, |
| 17 text = typography.black, | 19 toolbarText = darkToolbar ? typography.white : typography.black, |
| 18 backgroundColor = colors.Grey[50], | 20 text = typography.black; |
| 19 dialogColor = colors.White; | |
| 20 | 21 |
| 21 ThemeData.dark({ this.primary, this.accent }) | 22 ThemeData.dark({ this.primary, this.accent }) |
| 22 : toolbarText = typography.white, | 23 : brightness = ThemeBrightness.dark, |
| 23 text = typography.white, | 24 toolbarText = typography.white, |
| 24 backgroundColor = colors.Grey[850], | 25 text = typography.white; |
| 25 dialogColor = colors.Grey[800]; | |
| 26 | 26 |
| 27 ThemeData.fallback() | 27 ThemeData.fallback() |
| 28 : primary = colors.Indigo, | 28 : brightness = ThemeBrightness.light, |
| 29 primary = colors.Indigo, |
| 29 accent = colors.PinkAccent, | 30 accent = colors.PinkAccent, |
| 30 toolbarText = typography.white, | 31 toolbarText = typography.white, |
| 31 text = typography.black, | 32 text = typography.black; |
| 32 backgroundColor = colors.Grey[50], | |
| 33 dialogColor = colors.White; | |
| 34 | 33 |
| 34 final ThemeBrightness brightness; |
| 35 final Map<int, Color> primary; | 35 final Map<int, Color> primary; |
| 36 final Map<int, Color> accent; | 36 final Map<int, Color> accent; |
| 37 final typography.TextTheme text; | 37 final typography.TextTheme text; |
| 38 final typography.TextTheme toolbarText; | 38 final typography.TextTheme toolbarText; |
| 39 final Color backgroundColor; | |
| 40 final Color dialogColor; | |
| 41 } | 39 } |
| OLD | NEW |