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

last letter is broken to next line instead of using smaller font #105

Open
devsef opened this issue Feb 16, 2022 · 3 comments
Open

last letter is broken to next line instead of using smaller font #105

devsef opened this issue Feb 16, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@devsef
Copy link

devsef commented Feb 16, 2022

**if I restrict the AutoSizeText to maxLines: 1 it is working but there are some tabs with two word so I need the 2 Lines. But if I set it to maxLines 2 the one word ('calendar.toUpperCase()) won't shrink its size but brake the last letter two the second line. That happens also without AutoSizeText package.

How can I achieve that only complete words will be written in the next line and not a single letter?**
Please tell me exactly how to reproduce the problem you are running into.

return Padding(
padding: const EdgeInsets.all(2.0),
child: Container(
decoration: BoxDecoration(
color: isSelected ? theme.focusColor : theme.dividerColor,
borderRadius: const BorderRadius.all(
Radius.circular(10.0),
),
),
child: Material(
color: Colors.transparent,
child: InkWell(
borderRadius: BorderRadius.circular(10),
onTap: onTap,
child: Center(
child: AutoSizeText(
value.localizedValue(localizations!).toUpperCase(),
minFontSize: 10,
maxLines: 2,
textAlign: TextAlign.center,
style: isSelected
? theme.primaryTextTheme.caption
: theme.textTheme.caption,
),
),
),
),
),
);

Provide a few simple lines of code to show your problem.

Screenshots
If applicable, add screenshots to help explain your problem.

Version

  • Flutter version: [e.g. 2.8.1]
  • auto_size_text version: [e.g. 3.0.0]
@devsef devsef added the bug Something isn't working label Feb 16, 2022
@devsef
Copy link
Author

devsef commented Feb 16, 2022

I figured out that this behavior is forced by upper case writing. therefore it dosn't matter if you write it "CALENDAR"or "calendar.toUppaerCase()"
So is there an option to brake a line only after a blanc space

@CarloTerracciano
Copy link

@devsef try to put wrapWords: false inside yuor AutoSizeText element.

@SeriousMonk
Copy link

Case closed

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

3 participants