-
-
Notifications
You must be signed in to change notification settings - Fork 243
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
Adds support for 'SelectableText' #94
base: master
Are you sure you want to change the base?
Conversation
@leisim Is it possible to merge this and publish this feature? |
Hi @TjarcoKerssens, auto_size_text:
git:
url: https://github.com/definitelyme/auto_size_text.git
ref: ft/selectable-text |
Can't you just use textBuilder for this? |
What widget is that? There isn't a TextBuilder widget in Flutter |
@definitelyme Thanks for this feature, I needed it in a project of mine. These are two I found this issue that explains that there is a tiny extra margin with the In order to fix this and correctly calculate a fitting font size, we need to account for this margin in the if (widget._isSelectableText) {
textPainter.layout(maxWidth: constraints.maxWidth - widget.cursorWidth - 1.0);
} else {
textPainter.layout(maxWidth: constraints.maxWidth);
} I tested this and it seems to work. |
Nice! I didn't notice this, I'll update my PR. |
@definitelyme Any update on this? |
@PcolBP Is this after using the change I proposed in my comment before? If not its the same issue. |
@schultek Yeah, thats it. For me was enought to set just:
But, I've noticed some weird behavior. A text is blurry after shrinking. Upper text is Selectable, bottom is Text. I've created own fork with customBuilders:
EDIT: Issue with blurry text related to #81215 |
I have updated my PR to include the fix you suggested. |
Thanks for this branch! |
@amejiarosario |
…auto_size_text into ft/selectable-text
Since Flutter 3.3 you can use the |
Tested on Android, iOS & Web platforms.