Update constructor of RichTextProxy

pull/573/head
X Code 3 years ago
parent 56ef9f46d0
commit d934c1a882
  1. 19
      lib/src/widgets/proxy.dart
  2. 15
      lib/src/widgets/text_line.dart

@ -131,16 +131,17 @@ class RenderEmbedProxy extends RenderProxyBox implements RenderContentProxyBox {
class RichTextProxy extends SingleChildRenderObjectWidget { class RichTextProxy extends SingleChildRenderObjectWidget {
/// Child argument should be an instance of RichText widget. /// Child argument should be an instance of RichText widget.
const RichTextProxy( const RichTextProxy(
RichText child, {required RichText child,
this.textStyle, required this.textStyle,
this.textAlign, required this.textAlign,
this.textDirection, required this.textDirection,
this.textScaleFactor, required this.locale,
this.locale, required this.strutStyle,
this.strutStyle, this.textScaleFactor = 1.0,
this.textWidthBasis, this.textWidthBasis = TextWidthBasis.parent,
this.textHeightBehavior, this.textHeightBehavior,
) : super(child: child); Key? key})
: super(key: key, child: child);
final TextStyle textStyle; final TextStyle textStyle;
final TextAlign textAlign; final TextAlign textAlign;

@ -150,15 +150,12 @@ class _TextLineState extends State<TextLine> {
textScaleFactor: MediaQuery.textScaleFactorOf(context), textScaleFactor: MediaQuery.textScaleFactorOf(context),
); );
return RichTextProxy( return RichTextProxy(
child, textStyle: textSpan.style!,
textSpan.style!, textAlign: textAlign,
textAlign, textDirection: widget.textDirection!,
widget.textDirection!, strutStyle: strutStyle,
1, locale: Localizations.localeOf(context),
Localizations.localeOf(context), child: child);
strutStyle,
TextWidthBasis.parent,
null);
} }
InlineSpan _getTextSpanForWholeLine(BuildContext context) { InlineSpan _getTextSpanForWholeLine(BuildContext context) {

Loading…
Cancel
Save