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

AutoSizeText as a child of ListView dosn't autosize the text #112

Open
Sbenari opened this issue Apr 4, 2022 · 0 comments
Open

AutoSizeText as a child of ListView dosn't autosize the text #112

Sbenari opened this issue Apr 4, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@Sbenari
Copy link

Sbenari commented Apr 4, 2022

It appears that AutoSizeText picks the maximum font size when is a child of ListView, instead of auto-sizing the text based on available space. In my case, I use 300 as the font size.

Steps to Reproduce
I've placed the AutoSiezext as a child of the ListView.

Code sample

Expanded(
flex: 9,
itemCount: resultS.length,
separatorBuilder: (BuildContext context, int index) => Divider(thickness: 1, color: Colors.grey.shade800),
itemBuilder: (BuildContext context, int index) {
child: AutoSizeText(
resultS[index],
textScaleFactor: 1.0,
style: const TextStyle(
fontFamily: 'Arial-Narrow',                                     
letterSpacing: -0.5,
color: Colors.yellow,
fontSize: 300,
),
minFontSize: 0,
//overflow: TextOverflow.ellipsis,
),                                                 
alignment: Alignment.topRight);
},
),
),

Screenshots
The list of the yellow numbers is What I should get. in this case, ScreenUtil is used instead of AutoSizeText
Screen Shot 2022-04-04 at 4 33 46 PM

This is what I'm getting when using AutoSizeText
Screen Shot 2022-04-04 at 4 28 57 PM

Version

  • Flutter version: [e.g. 2.8.1]
  • auto_size_text version: [e.g. 1.2.1]
@Sbenari Sbenari added the bug Something isn't working label Apr 4, 2022
@Sbenari Sbenari changed the title AutoSizeText doesn't work inside ListView AutoSizeText doesn't work as a child in ListView Apr 4, 2022
@Sbenari Sbenari changed the title AutoSizeText doesn't work as a child in ListView AutoSizeText as a child of ListView dosn't autosize the text Apr 4, 2022
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

1 participant