Skip to content

How to add custom overflow string in Text or TextSpan? #26748

Open
@Mericusta

Description

@Mericusta

image

I want to replace overflow string '\u2026' to something else, like '...read more'.

Activity

changed the title [-]text wrap[/-] [+]How to add custom overflow string in 'Text' or 'TextSpan' ?[/+] on Jan 18, 2019
zoechi

zoechi commented on Jan 18, 2019

@zoechi
Contributor

Text uses RichText and RichText uses RenderParagraph which also doesn't take a custom value

ellipsis: overflow == TextOverflow.ellipsis ? _kEllipsis : null,

uses _kEllipsis

You would need to create a custom clone of RenderParagraph.

added
c: new featureNothing broken; request for a new capability
frameworkflutter/packages/flutter repository. See also f: labels.
on Jan 18, 2019
added this to the Goals milestone on Jan 18, 2019
zmtzawqlp

zmtzawqlp commented on Feb 25, 2019

@zmtzawqlp
Contributor

Text uses RichText and RichText uses RenderParagraph which also doesn't take a custom value

flutter/packages/flutter/lib/src/rendering/paragraph.dart

Line 64 in d927c93

ellipsis: overflow == TextOverflow.ellipsis ? _kEllipsis : null,
uses _kEllipsis

You would need to create a custom clone of RenderParagraph.

for more, it better to provide the way to custom the ellipsis style, and the ellipsis like "...read more" should be to be tapped.

zmtzawqlp

zmtzawqlp commented on Mar 15, 2019

@zmtzawqlp
Contributor

@Mericusta hi guy, there is a workaround for this issue , see does it help for you.

OHeroJ

OHeroJ commented on Apr 15, 2019

@OHeroJ

the same issue to me? have some good way?

changed the title [-]How to add custom overflow string in 'Text' or 'TextSpan' ?[/-] [+]How to add custom overflow string in `Text` or `TextSpan`?[/+] on Jan 7, 2020
rayliverified

rayliverified commented on Feb 5, 2020

@rayliverified

This feature would be really nice to have. I would like to customize the ellipsis to "...continue reading".

mr-mmmmore

mr-mmmmore commented on Feb 28, 2020

@mr-mmmmore

Using the extended_text package seems overkill to me, we only need to be able to simply replace a string by another.

If there was a way to override _kEllipsis that would be great, for example by adding an overflowText parameter to the widgets's constructors that use TextOverflow.ellipsis.

lukepighetti

lukepighetti commented on Mar 4, 2020

@lukepighetti
Contributor

We could resolve this with a ignoreOverflow property on a TextSpan. That way we can add a text span after the ... ellipsis in any color and with a gesture recognizer.

added
P2Important issues not at the top of the work list
on May 29, 2020
zmtzawqlp

zmtzawqlp commented on Jul 1, 2020

@zmtzawqlp
Contributor

https://github.com/fluttercandies/extended_text ,support Widget as TextOverflow now.

11 remaining items

campovski

campovski commented on Nov 2, 2022

@campovski
Contributor

I would like to work on this and provide option to add custom widget instead of just text.

pedromassango

pedromassango commented on Nov 3, 2022

@pedromassango
Member

I would like to work on this and provide option to add custom widget instead of just text.

Thanks @campovski. Feel free to open a PR and link it to this issue.

jagged3dge

jagged3dge commented on Apr 18, 2023

@jagged3dge

@campovski Glad to see someone's on it. It's now Apr 2023. Any progress so far?

flutter-triage-bot

flutter-triage-bot commented on Jul 8, 2023

@flutter-triage-bot

This issue is assigned but has had no recent status updates. Please consider unassigning this issue if it is not going to be addressed in the near future. This allows people to have a clearer picture of what work is actually planned. Thanks!

added
Bot is counting down the days until it unassigns the issue
on Jul 30, 2023
flutter-triage-bot

flutter-triage-bot commented on Aug 1, 2023

@flutter-triage-bot

This issue was assigned to @campovski but has had no status updates in a long time. To remove any ambiguity about whether the issue is being worked on, the assignee was removed.

removed
Bot is counting down the days until it unassigns the issue
on Aug 1, 2023
seanhamstra

seanhamstra commented on Aug 29, 2023

@seanhamstra

Would love this feature as well!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: new featureNothing broken; request for a new capabilityframeworkflutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @zoechi@Hixie@lukepighetti@kf6gpe@darkstarx

        Issue actions

          How to add custom overflow string in `Text` or `TextSpan`? · Issue #26748 · flutter/flutter