simc / auto_size_text

Flutter widget that automatically resizes text to fit perfectly within its bounds.
https://pub.dev/packages/auto_size_text
MIT License
2.06k stars 240 forks source link

Change Default of wrapWords to false #100

Open jbryanh opened 3 years ago

jbryanh commented 3 years ago

The current default of attribute wrapWords is true. This creates a situation, that if you have a maxLines more than 1 line, you can, and frequently have, words wrap like below:

Uploa d

The original rationale for this decision was that this is consistent with the original Text Widget line breaking behavior. I haven't seen it break a word like "Upload" into a "Uploa" on one line and then the "d" below alone....which is what the default behavior for AutoSizeText does unless you over-ride the default wrapWords.

I'd propose defaulting wrapWords to false because I estimate that 99% of use cases prefer it...regardless of the consistency to Text widget. AutoSizeText is being used because Text was inadequate, so maintaining some of it's inadequacies for principle's sake seems silly to me.

I'd add that 50% of plugin users probably abandon the plugin mid-understanding without fully investigating the strange behavior out of the box.

simc commented 3 years ago

I completely agree! I'll change that with the next release.

ventr1x commented 2 years ago

Well, I tested especially long one words and they also wrap with wrapWords: true. So that would not solve anything with all the underlying bugs going around.

As this should be a drop in replacement, wrapWords should NOT be true as a default.

simc commented 2 years ago

@ventr1x I have not heard about an issue with very long words. Are you sure the words can be non-wrapped and still be within the other constraints (minFontSize etc.)