You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use Html widget to display some html text. But I set my phone's text scale small, so text scaling is strange.
Later, I found a solution related to #308. Although the text is still small, but it is better if I use Html directly. I really want to solve this problem. Here is my code:
final fontSize =Theme.of(context).textTheme.bodyText2.fontSize /MediaQuery.of(context).textScaleFactor; // divide by scale factor// ...Html(
data: item,
style: {
'*':Style(fontSize:FontSize(fontSize)),
},
),
// ...
Small scale factor: (0.85)
Before: (too small)
After: (small yet)
Normal scale factor: (1.0)
Before:
After:
Large scale factor: (1.15)
Before: (too large)
After:
Control panel:
Addition:
If I divide by scale * scale, it seems to be right? (0.85, text with shadow is Text and below is Html)
final scale =MediaQuery.of(context).textScaleFactor ??1.0;
final fontSize =Theme.of(context).textTheme.bodyText2.fontSize / (scale * scale);
The text was updated successfully, but these errors were encountered:
Android 8 / 10
flutter_html: ^1.0.0-pre.1
Flutter: 1.19.0-2.0.pre.83
I use
Html
widget to display some html text. But I set my phone's text scale small, so text scaling is strange.Later, I found a solution related to #308. Although the text is still small, but it is better if I use
Html
directly. I really want to solve this problem. Here is my code:Small scale factor: (0.85)
Before:
(too small)
(small yet)
After:
Normal scale factor: (1.0)
Before:

After:
Large scale factor: (1.15)
Before:
(too large)
After:
Control panel:
Addition:
If I divide by
scale * scale
, it seems to be right? (0.85, text with shadow isText
and below isHtml
)The text was updated successfully, but these errors were encountered: