You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a need to truncate a list of text in a position other than the end.
I have a list of masked bank account numbers, some of them can be quite long that it overflows. While I could specify maxLines to limit how far the Text wraps, in Flutter it'll always truncate the end of the Text. This is not ideal for my use case because let's say there are multiple entries from the same bank, then there's no way the user can distinguish them because the end is always truncated.
Can we have this feature implemented on Flutter as well?
Proposal
To have this implemented as part of the Text widget API.
Text(
'Some very very long text that only differs by its ending hehe',
truncationPosition: TruncationPosition.middle,
);
Text(
'Some very very long text that only differs by its ending haha',
truncationPosition: TruncationPosition.middle,
);
Or, it could be added into TextOverflow enum to avoid possible conflict between truncation position and the overflow mode (eg visible at the middle) like so:
Hi @digawp
I see there's an open issue addressing the case you described.
Please follow up on that issue,
I'm closing the current one as duplicate.
If you disagree please write in the comments
and I will reopen it.
Thank you
Sorry this is my fault since I asked @digawp to open this issue. I wasn't aware of #45336 but it does look like it describes this problem. I'll focus on that one.
<
7E92
form class="js-pick-reaction" data-turbo="false" action="/flutter/flutter/reactions" accept-charset="UTF-8" method="post">
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
lockbot
locked and limited conversation to collaborators
Apr 25, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Use case
I have a need to truncate a list of text in a position other than the end.
I have a list of masked bank account numbers, some of them can be quite long that it overflows. While I could specify
maxLines
to limit how far the Text wraps, in Flutter it'll always truncate the end of the Text. This is not ideal for my use case because let's say there are multiple entries from the same bank, then there's no way the user can distinguish them because the end is always truncated.This feature is available on the native platforms -
android:ellipsize
in Android and intruncationMode
in iOS.Can we have this feature implemented on Flutter as well?
Proposal
To have this implemented as part of the
Text
widget API.Or, it could be added into
TextOverflow
enum to avoid possible conflict between truncation position and the overflow mode (egvisible
at the middle) like so:The text was updated successfully, but these errors were encountered: