From f6af6081fdf770080f28e54aaaf1650e62877126 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 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/src/expand_text.dart b/lib/src/expand_text.dart index fe70ecc..37b9600 100644 --- a/lib/src/expand_text.dart +++ b/lib/src/expand_text.dart @@ -184,6 +184,7 @@ class _ExpandTextState extends State return LayoutBuilder( builder: (context, size) { final defaultTextStyle = (child as DefaultTextStyle).style; + final textScaler = MediaQuery.textScalerOf(context); final textPainter = TextPainter( text: TextSpan( @@ -191,6 +192,7 @@ class _ExpandTextState extends State style: defaultTextStyle, ), textDirection: TextDirection.ltr, + textScaler: textScaler, maxLines: widget.maxLines, )..layout(maxWidth: size.maxWidth);