From d934c1a8828b7b495cdf0e5e785942b98a9a2936 Mon Sep 17 00:00:00 2001 From: X Code Date: Mon, 27 Dec 2021 08:52:13 -0800 Subject: [PATCH] Update constructor of RichTextProxy --- lib/src/widgets/proxy.dart | 21 +++++++++++---------- lib/src/widgets/text_line.dart | 15 ++++++--------- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/lib/src/widgets/proxy.dart b/lib/src/widgets/proxy.dart index f002ec94..b9f683e1 100644 --- a/lib/src/widgets/proxy.dart +++ b/lib/src/widgets/proxy.dart @@ -131,16 +131,17 @@ class RenderEmbedProxy extends RenderProxyBox implements RenderContentProxyBox { class RichTextProxy extends SingleChildRenderObjectWidget { /// Child argument should be an instance of RichText widget. const RichTextProxy( - RichText child, - this.textStyle, - this.textAlign, - this.textDirection, - this.textScaleFactor, - this.locale, - this.strutStyle, - this.textWidthBasis, - this.textHeightBehavior, - ) : super(child: child); + {required RichText child, + required this.textStyle, + required this.textAlign, + required this.textDirection, + required this.locale, + required this.strutStyle, + this.textScaleFactor = 1.0, + this.textWidthBasis = TextWidthBasis.parent, + this.textHeightBehavior, + Key? key}) + : super(key: key, child: child); final TextStyle textStyle; final TextAlign textAlign; diff --git a/lib/src/widgets/text_line.dart b/lib/src/widgets/text_line.dart index 32648d8f..db0fc973 100644 --- a/lib/src/widgets/text_line.dart +++ b/lib/src/widgets/text_line.dart @@ -150,15 +150,12 @@ class _TextLineState extends State { textScaleFactor: MediaQuery.textScaleFactorOf(context), ); return RichTextProxy( - child, - textSpan.style!, - textAlign, - widget.textDirection!, - 1, - Localizations.localeOf(context), - strutStyle, - TextWidthBasis.parent, - null); + textStyle: textSpan.style!, + textAlign: textAlign, + textDirection: widget.textDirection!, + strutStyle: strutStyle, + locale: Localizations.localeOf(context), + child: child); } InlineSpan _getTextSpanForWholeLine(BuildContext context) {