simc / auto_size_text

Flutter widget that automatically resizes text to fit perfectly within its bounds.
https://pub.dev/packages/auto_size_text
MIT License
2.06k stars 241 forks source link

Android bug what is it? #11

Closed 1AlexFix1 closed 5 years ago

1AlexFix1 commented 5 years ago
Container(
                        height: 50,
                        width: 40,
                        alignment: Alignment.center,
                        child: AutoSizeText(
                          '999',
                          style: TextStyle(fontSize: 100),
                          textAlign: TextAlign.center,
                          maxLines: 1,
                        ),
                      ),

This code works fine in any IOS device, but on Android, the last letter goes to the next line, if you slightly increase the height you will see why this happens? But FittedBox help this

simc commented 5 years ago

I'm looking into this...

simc commented 5 years ago

Your sample works fine for me. Even if I change the width or height of the container... Could you test it again and maybe create a small test project?

1AlexFix1 commented 5 years ago

Your sample works fine for me. Even if I change the width or height of the container... Could you test it again and maybe create a small test project?

There is a problem in that it is reproduced on my real device honor 8, while on the emulator everything worked fine. I'll take a few more phones and test them on the answer as soon as I do it.

1AlexFix1 commented 5 years ago

I launched on several real devices and everything is OK there, this is a very strange bug, I go into the phone settings, I didn’t change anything with the text, everything is default, how do you think it could be? my phone honor 8 model FRD-L09

simc commented 5 years ago

Are you using auto_size_text v1.1.2? If not please update to the latest version. Also try setting your minFontSize to 0.

ajkerfaisal commented 5 years ago

Are you using auto_size_text v1.1.2? If not please update to the latest version. Also try setting your minFontSize to 0.

by setting minFontSize it resolved for me

simc commented 5 years ago

The problem was that one of your phones seems to have a slightly larger font size and your AutoSizeText hit the minFontSize and could not resize further...

1AlexFix1 commented 5 years ago

done! thank you