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

Side by Side Diff: sky/sdk/lib/widgets/theme.dart

Issue 1217623002: Support for background images on cards, style demo home (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: rebase 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 unified diff | Download patch
« no previous file with comments | « sky/sdk/lib/widgets/scrollable.dart ('k') | sky/sdk/lib/widgets/widget.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 '../theme/theme_data.dart'; 5 import '../theme/theme_data.dart';
6 import 'basic.dart'; 6 import 'basic.dart';
7 import 'widget.dart'; 7 import 'widget.dart';
8 8
9 export '../theme/theme_data.dart' show ThemeBrightness; 9 export '../theme/theme_data.dart' show ThemeData, ThemeBrightness;
10 10
11 class Theme extends Inherited { 11 class Theme extends Inherited {
12 12
13 Theme({ 13 Theme({
14 String key, 14 String key,
15 this.data, 15 this.data,
16 Widget child 16 Widget child
17 }) : super(key: key, child: child) { 17 }) : super(key: key, child: child) {
18 assert(child != null); 18 assert(child != null);
19 assert(data != null); 19 assert(data != null);
20 } 20 }
21 21
22 final ThemeData data; 22 final ThemeData data;
23 23
24 static final ThemeData _kFallbackTheme = new ThemeData.fallback(); 24 static final ThemeData _kFallbackTheme = new ThemeData.fallback();
25 25
26 static ThemeData of(Component component) { 26 static ThemeData of(Component component) {
27 Theme theme = component.inheritedOfType(Theme); 27 Theme theme = component.inheritedOfType(Theme);
28 return theme == null ? _kFallbackTheme : theme.data; 28 return theme == null ? _kFallbackTheme : theme.data;
29 } 29 }
30 } 30 }
OLDNEW
« no previous file with comments | « sky/sdk/lib/widgets/scrollable.dart ('k') | sky/sdk/lib/widgets/widget.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698