diff --git a/flutter_highlighting/lib/flutter_highlighting.dart b/flutter_highlighting/lib/flutter_highlighting.dart index f490a6b0..ef1a921d 100644 --- a/flutter_highlighting/lib/flutter_highlighting.dart +++ b/flutter_highlighting/lib/flutter_highlighting.dart @@ -90,8 +90,8 @@ class HighlightView extends StatelessWidget { return Container( color: theme[_rootKey]?.backgroundColor ?? _defaultBackgroundColor, padding: padding, - child: RichText( - text: TextSpan( + child: Text.rich( + TextSpan( style: _textStyle, children: _convert( highlight.highlight(languageId ?? '', source, true).nodes ?? [],