auto_size_text icon indicating copy to clipboard operation
auto_size_text copied to clipboard

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

Open devsef opened this issue 4 years ago • 3 comments

**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 avatar Feb 16 '22 11:02 devsef

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 avatar Feb 16 '22 11:02 devsef

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

CarloTerracciano avatar Feb 25 '22 17:02 CarloTerracciano

Case closed

SeriousMonk avatar Mar 25 '22 19:03 SeriousMonk