Chromium Code Reviews| Index: sky/sdk/lib/widgets/icon_theme.dart |
| diff --git a/sky/sdk/lib/widgets/icon_theme.dart b/sky/sdk/lib/widgets/icon_theme.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..2cb084c281a3a10d82cc517d3a02e847eb06e5c4 |
| --- /dev/null |
| +++ b/sky/sdk/lib/widgets/icon_theme.dart |
| @@ -0,0 +1,35 @@ |
| +// 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.
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +import 'basic.dart'; |
| +import 'widget.dart'; |
| + |
| +enum IconThemeColor { white, black } |
| + |
| +class IconThemeData { |
| + const IconThemeData({ this.color }); |
| + final IconThemeColor color; |
| +} |
| + |
| +class IconTheme extends Inherited { |
| + |
| + IconTheme({ |
| + String key, |
| + this.data, |
| + Widget child |
| + }) : super(key: key, child: child) { |
| + assert(data != null); |
| + assert(child != null); |
| + } |
| + |
| + final IconThemeData data; |
| + |
| + static IconThemeData of(Component component) { |
| + IconTheme result = component.inheritedOfType(IconTheme); |
| + return result == null ? null : result.data; |
| + } |
| + |
| + bool syncShouldNotify(IconTheme old) => data != old.data; |
| + |
| +} |