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

AutoSizeText is resizing, but cut the resulting string #64

Open 0xbadb0d00 opened 4 years ago

0xbadb0d00 commented 4 years ago

Version

Hello, I'am trying to use your wonderful plugin, but it, even if plugin did a resizing, doesn't work correctly.

I am trying following test code to show that string in just 2 lines:

`

                        new SizedBox(
                          height: 30.0,
                          child: new AutoSizeText(
                            "qA6HMMbvyCKZM8rmy66iVKZyy6B5ogeJijipTJMUkvi62an95HVh6WGoBwSV8ZSZNWGD3lFVVx4MX3ZHIP8vu71kEwhHD0k5JUlFYeBP4kY9rcDfKyQAlbeP8ck0o4hi7wcq4tsXTFGEcAJmfsSkA6XNdzLwOPmwDjwA7gbdhXN7knItyxaY1r3ze68OPsAXV6jIvx63M339XQigzshq8TVLsy3XiPa2Fju5bcnidgrlRdCztcFJXANoyF2G2VT4qhc1aI2qHi5JR3kadh8XYleSClis06lPdt896hyTsFRP",
                            maxLines: 2,
                          ),
                        ),

`

This is what I see with a normal Text Widget:

qemu-system-x86_64_5vRQDm4MyB

This is instead what I see with AutoSizeText Widget:

qemu-system-x86_64_Ewac31h6Qi

The text size switched from 14 to 12 with AutoSizeText Widget, but the resulting text is cutted.

Can you please check it? Do you have any suggestion?

1207roy commented 4 years ago

I have also faced the same issue. Am I missing something here?

SizedBox(
        width: 324.0
        height: 30.0,
        child: AutoSizeText(
          'some long text string',
          style: TextStyle(color: Colors.red),
          maxLines: 1,
          group: someTextGroup,
        ),
      )
matthewlloyd commented 4 years ago

Check the minFontSize setting, the default is 12 points. In the screenshots, the font size appears to be larger with the AutoSizeText than with the normal Text widget. What is the font size with the normal Text widget?

easazade commented 4 years ago

i am having this problem as well it is just cutting the string

easazade commented 4 years ago

Just use FittedBox instead of AutoSizeText

FittedBox(
    child: Text('my long text ...'),
)
rohan20 commented 3 years ago

Set minFontSize to 8 or 10. Still feels legible with this font size.

flawnn commented 1 year ago

Just use FittedBox instead of AutoSizeText

FittedBox(
    child: Text('my long text ...'),
)

image Just wrapping the (Autosize)Text Widget into a FittedBox does it. No need to resort only to Text.