From fcaaceca66bc4f23934865df09d130797bb319fc Mon Sep 17 00:00:00 2001 From: Veronika Laskova Date: Thu, 2 May 2024 11:43:34 +1200 Subject: [PATCH] add text scaler information to expand text widget --- lib/src/expand_text.dart | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/src/expand_text.dart b/lib/src/expand_text.dart index fe70ecc..e29991e 100644 --- a/lib/src/expand_text.dart +++ b/lib/src/expand_text.dart @@ -24,6 +24,12 @@ class ExpandText extends StatefulWidget { /// Corresponds to the style parameter of the text view. final TextStyle? style; + /// Corresponds to the textScaler parameter of the text view. + /// Default value is: [TextScaler.noScaling]. + /// If user has information about scale factor, it can be passed here + /// To better determine whether widget overflows or not when accessibility affects text size. + final TextScaler textScaler; + /// Corresponds to the aling parameter of the text view. final TextAlign textAlign; @@ -91,6 +97,7 @@ class ExpandText extends StatefulWidget { this.maxLines = 8, this.style, this.textAlign = TextAlign.justify, + this.textScaler = TextScaler.noScaling, this.overflow = TextOverflow.fade, this.expandWidth = false, this.expandOnGesture = false, @@ -191,6 +198,7 @@ class _ExpandTextState extends State style: defaultTextStyle, ), textDirection: TextDirection.ltr, + textScaler: widget.textScaler, maxLines: widget.maxLines, )..layout(maxWidth: size.maxWidth);