OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 import '../painting/text_style.dart'; |
| 6 import 'basic.dart'; |
| 7 import 'widget.dart'; |
| 8 |
| 9 class DefaultTextStyle extends Inherited { |
| 10 |
| 11 DefaultTextStyle({ |
| 12 String key, |
| 13 this.style, |
| 14 Widget child |
| 15 }) : super(key: key, child: child) { |
| 16 assert(style != null); |
| 17 assert(child != null); |
| 18 } |
| 19 |
| 20 final TextStyle style; |
| 21 |
| 22 static TextStyle of(Component component) { |
| 23 DefaultTextStyle result = component.inheritedOfType(DefaultTextStyle); |
| 24 return result == null ? null : result.style; |
| 25 } |
| 26 } |
OLD | NEW |