diff --git a/packages/flutter/lib/src/painting/text_painter.dart b/packages/flutter/lib/src/painting/text_painter.dart index b5140f3bbd..ed8cdcf71e 100644 --- a/packages/flutter/lib/src/painting/text_painter.dart +++ b/packages/flutter/lib/src/painting/text_painter.dart @@ -309,7 +309,7 @@ class _NewTextPainter implements TextPainter { _text = value; ui.ParagraphBuilder builder = new ui.ParagraphBuilder(); _text.build(builder); - _paragraph = builder.build(_text.paragraphStyle); + _paragraph = builder.build(_text.paragraphStyle ?? new ui.ParagraphStyle()); _needsLayout = true; } diff --git a/packages/flutter/lib/src/painting/text_style.dart b/packages/flutter/lib/src/painting/text_style.dart index 86aa5febd0..28a67bf53e 100644 --- a/packages/flutter/lib/src/painting/text_style.dart +++ b/packages/flutter/lib/src/painting/text_style.dart @@ -151,8 +151,27 @@ class TextStyle { return toCSS[decorationStyle]; } - ui.TextStyle get textStyle => null; - ui.ParagraphStyle get paragraphStyle => null; + ui.TextStyle get textStyle { + return new ui.TextStyle( + color: color, + decoration: decoration, + decorationColor: decorationColor, + decorationStyle: decorationStyle, + fontWeight: fontWeight, + fontStyle: fontStyle, + fontFamily: fontFamily, + fontSize: fontSize + ); + } + + ui.ParagraphStyle get paragraphStyle { + return new ui.ParagraphStyle( + // TODO(abarth): Restore once the analyzer can see the new dart:ui interface. + // textAlign: textAlign, + textBaseline: textBaseline, + lineHeight: height + ); + } /// Program this text style into the engine ///