last letter is broken to next line instead of using smaller font
**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]
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
@devsef try to put wrapWords: false inside yuor AutoSizeText element.
Case closed