Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text with more lines than maxLines results in the font size being the minFontSize #57

Open
gapspt opened this issue May 21, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@gapspt
Copy link

gapspt commented May 21, 2020

Steps to Reproduce
Trying to resize a text that has more lines in itself more than the allowed maxLines results in the font size to be the minFontSize and the displayed lines to be only maxLines, leaving an empty space bellow.
Expected result - Either:
1 - Cap the input text to maxLines lines first and then apply the rest of the resizing algorithm; or
2 - Apply the maximum possible lines possible when reaching the minFontSize.

The first option would be more consistent with the behaviour of Text(), which caps the lines to maxLines.

Code sample

Row(
      children: <Widget>[
        SizedBox(
          width: 100,
          height: 100,
          child: Text("1\n2\n3\n4\n5", maxLines: 4),
        ),
        SizedBox(
          width: 100,
          height: 100,
          child: AutoSizeText("1\n2\n3\n4\n5", maxLines: 4, minFontSize: 5),
        ),
      ],
    )

Screenshots
Screenshot for the example above:
image

Version

  • Flutter version: 1.17.1
  • auto_size_text version: ^2.1.0
@gapspt gapspt added the bug Something isn't working label May 21, 2020
@AhmedNourJamalElDin
Copy link

I face the following problem and I think it's the same in this issue:
showing 1,2,3,4,5,6,7 in separate lines with maxLines = 4

1
2
3
4

now resizing to show the rest

1
2
3
4
5
6
7

this would only show the first 4 numbers even though there are some space to fill (the difference between maxFontSize and minFontSize)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants