Closed apaatsio closed 6 years ago
I didn't have time to write the tests yet. There are a few old ones which fail.
I'm already using v0.2.0 in production and it works perfectly. Could you show me how you use the widget?
You can also try the demo app.
Here's a simple example app that is not working expectedly for me:
Widget build(BuildContext context) {
return MaterialApp(
home: SafeArea(
top: true,
child: Material(
child: Row(
children: [
Expanded(
child: AutoSizeText(
'This should be at least size 25.0',
minFontSize: 25.0,
))]))));
}
Edit: Here's a screenshot. It looks like the default font size. I expected the text to be bigger.
Thank you! I can reproduce the problem and I'm working on it ;)
Sorry for the inconvenience. It should work now (v0.2.1). Please open the issue again if there are still problems.
Now the minFontSize works in the sense that the font size is exactly at minFontSize. But it still doesn't stretch the text to the full width of the screen (using the code example I posted in the earlier comment).
The font size does not exceed the fontSize
of your TextStyle
(or the inherited fontSize
if none is set). Try something like
AutoSizeText(
"This should work now",
style: TextStyle(fontSize:100.0),
minFontSize: 25.0,
)
Ok, that way it works exactly as I want. Thanks!
The tests are failing for the 0.2.0 release: https://travis-ci.com/leisim/auto_size_text/builds/85639827
Is the version 0.2.0 supposed to work? I can't get it to work. Even when I'm trying something like
AutoSizeText('foo', minFontSize: 50.0, maxFontSize: 100.0)
the text is rendered at the default font size (12.0).