8000 Text Truncation Position · Issue #54316 · flutter/flutter · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Text Truncation Position< 8000 /bdi> #54316

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

Closed
digawp opened this issue Apr 8, 2020 · 3 comments
Closed

Text Truncation Position #54316

digawp opened this issue Apr 8, 2020 · 3 comments

Comments

@digawp
Copy link
digawp commented Apr 8, 2020

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 in truncationMode in iOS.

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:

enum TextOverflow {
  ...
  ellipsisMiddle,
  ellipsisStart,
}
@iapicca
Copy link
Contributor
iapicca commented Apr 9, 2020

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

@iapicca iapicca closed this as completed Apr 9, 2020
@justinmc
Copy link
Contributor
justinmc commented Apr 9, 2020

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.

@lock
Copy link
lock bot commented Apr 25, 2020

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.

@lock lock bot locked and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
0