Closed Koridev closed 5 years ago
Thanks for reporting this. I'll fix it :+1:
The case where only AutoSizeText
has a style was a bug that I fixed.
The other case wasn't: Since your AutoSizeText
doesn't have a style, the default style is used (probably fontSize = 14
). To fit the large span, AutoSizeText
has to scale the text down. But the default minFontSize
is 12 and since the "reference fontSize" is 14, the text is not scaled down very far. Just set minFontSize
to 0.1 and it will work.
Note: You probably also have to use a smaller stepGranularity
(like 0.1) because the steps will be very large.
It would be very helpful if you could verify that the first case is fixed before I release a new version.
Just add this to your dependecies:
dependencies:
auto_size_text:
git:
url: git://github.com/leisim/auto_size_text.git
ref: style-fix
Edit: I added a troubleshooting guide for the second case.
Yes, the fix works!
When using AutoSizeText.rich, it seems that I can only have correct autosizing when the fontSize is declared both in the AutoSizeText's style and in the TextSpan's, unlike what is said in the documentation.
A short sample to test it:
Only the last widget of the Column will be auto sized.
Using auto_size_text: ^1.1.0