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'; | 7 import 'typography.dart' as typography; |
| 8 import 'colors.dart' as colors; |
8 | 9 |
9 class ThemeData { | 10 class ThemeData { |
10 const ThemeData({ this.text, this.color }); | 11 |
11 final TextTheme text; | 12 ThemeData.light({ |
12 final Map<int, Color> color; | 13 this.primary, |
| 14 this.accent, |
| 15 bool darkToolbar: false }) |
| 16 : toolbarText = darkToolbar ? typography.white : typography.black, |
| 17 text = typography.black, |
| 18 backgroundColor = colors.Grey[50], |
| 19 dialogColor = colors.White; |
| 20 |
| 21 ThemeData.dark({ this.primary, this.accent }) |
| 22 : toolbarText = typography.white, |
| 23 text = typography.white, |
| 24 backgroundColor = colors.Grey[850], |
| 25 dialogColor = colors.Grey[800]; |
| 26 |
| 27 ThemeData.fallback() |
| 28 : primary = colors.Indigo, |
| 29 accent = colors.PinkAccent, |
| 30 toolbarText = typography.white, |
| 31 text = typography.black, |
| 32 backgroundColor = colors.Grey[50], |
| 33 dialogColor = colors.White; |
| 34 |
| 35 final Map<int, Color> primary; |
| 36 final Map<int, Color> accent; |
| 37 final typography.TextTheme text; |
| 38 final typography.TextTheme toolbarText; |
| 39 final Color backgroundColor; |
| 40 final Color dialogColor; |
13 } | 41 } |
OLD | NEW |