OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
Hixie
2015/07/09 23:06:08
Put this in icon.dart, since only icons, and peopl
jackson
2015/07/09 23:16:19
Done.
| |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 import 'basic.dart'; | |
6 import 'widget.dart'; | |
7 | |
8 enum IconThemeColor { white, black } | |
9 | |
10 class IconThemeData { | |
11 const IconThemeData({ this.color }); | |
12 final IconThemeColor color; | |
13 } | |
14 | |
15 class IconTheme extends Inherited { | |
16 | |
17 IconTheme({ | |
18 String key, | |
19 this.data, | |
20 Widget child | |
21 }) : super(key: key, child: child) { | |
22 assert(data != null); | |
23 assert(child != null); | |
24 } | |
25 | |
26 final IconThemeData data; | |
27 | |
28 static IconThemeData of(Component component) { | |
29 IconTheme result = component.inheritedOfType(IconTheme); | |
30 return result == null ? null : result.data; | |
31 } | |
32 | |
33 bool syncShouldNotify(IconTheme old) => data != old.data; | |
34 | |
35 } | |
OLD | NEW |