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

Unified Diff: sky/sdk/lib/widgets/default_text_style.dart

Issue 1204523002: Material light and dark themes for Sky widgets (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: fix analyzer warning properly Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: sky/sdk/lib/widgets/default_text_style.dart
diff --git a/sky/sdk/lib/widgets/default_text_style.dart b/sky/sdk/lib/widgets/default_text_style.dart
new file mode 100644
index 0000000000000000000000000000000000000000..a8cc5f0d14a2b43657bba8b01719493b0d3cebf0
--- /dev/null
+++ b/sky/sdk/lib/widgets/default_text_style.dart
@@ -0,0 +1,26 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+import '../painting/text_style.dart';
+import 'basic.dart';
+import 'widget.dart';
+
+class DefaultTextStyle extends Inherited {
+
+ DefaultTextStyle({
+ String key,
+ this.style,
+ Widget child
+ }) : super(key: key, child: child) {
+ assert(style != null);
+ assert(child != null);
+ }
+
+ final TextStyle style;
+
+ static TextStyle of(Component component) {
+ DefaultTextStyle result = component.inheritedOfType(DefaultTextStyle);
+ return result == null ? null : result.style;
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698