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

Unified Diff: sky/sdk/lib/widgets/basic.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/basic.dart
diff --git a/sky/sdk/lib/widgets/basic.dart b/sky/sdk/lib/widgets/basic.dart
index 41be7998f7dcf786dcf6ed36039c163da6e62fb5..511bd4b81ac545e47eb695fc54ba0ce47f9dd6c4 100644
--- a/sky/sdk/lib/widgets/basic.dart
+++ b/sky/sdk/lib/widgets/basic.dart
@@ -13,6 +13,7 @@ import '../rendering/flex.dart';
import '../rendering/object.dart';
import '../rendering/paragraph.dart';
import '../rendering/stack.dart';
+import 'default_text_style.dart';
import 'widget.dart';
export '../rendering/box.dart' show BoxConstraints, BoxDecoration, Border, BorderSide, EdgeDims;
@@ -410,7 +411,18 @@ class Text extends Component {
bool get interchangeable => true;
Widget build() {
InlineBase text = new InlineText(data);
- if (style != null) text = new InlineStyle(style, [text]);
+ TextStyle defaultStyle = DefaultTextStyle.of(this);
+ TextStyle combinedStyle;
+ if (defaultStyle != null) {
+ if (style != null)
+ combinedStyle = defaultStyle.merge(style);
+ else
+ combinedStyle = defaultStyle;
+ } else {
+ combinedStyle = style;
+ }
+ if (combinedStyle != null)
+ text = new InlineStyle(combinedStyle, [text]);
return new Inline(text: text);
}
}

Powered by Google App Engine
This is Rietveld 408576698