2000calories / flutter_easy_rich_text

The EasyRichText widget provides an easy way to use RichText.
https://pub.dev/packages/easy_rich_text
MIT License
80 stars 33 forks source link

textScaleFactor overrides OS-Settings #20

Closed malmi closed 3 years ago

malmi commented 3 years ago

The textScaleFactor property on EasyRichText sets scale factor on a hardcoded value (1.0) if it is null. The default value should be MediaQuery.of(context).textScaleFactor, because the user could change the scale factor in the settings menu for accessibility.

Is it possible to change the hardcoded value to the dynamic value from MediaQueryData?

2000calories commented 3 years ago

Since the the default textScaleFactor in RichText is 1.0, I prefer not to change the default value considering the purpose of this Widget.

malmi commented 3 years ago

Just that i understand it correctly, RichText can't support this:

The only workaround would be to set the textScaleFactor manually on every usage, because it's overriding the correct textScaleFactors that the TextTheme would otherwise have. It's a source of bugs or at least rendering issues, because every other text-widget will scale correctly except RichText.

For me the solution would be to make textScaleFactor nullable, so it doesn't override anything and you have no compatibility issues. In the long run you could remove it, because it can be set via TextStyle if needed. Superscript can use the value from the TextStyle or from MediaQueryData.