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);