Skip to content
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

Option to add text by the end of the overflowed text and an action #33

Closed
LeoVen opened this issue Sep 11, 2019 · 2 comments
Closed

Option to add text by the end of the overflowed text and an action #33

LeoVen opened this issue Sep 11, 2019 · 2 comments
Labels
enhancement New feature or request

Comments

@LeoVen
Copy link

LeoVen commented Sep 11, 2019

Many times a text overflows, I would still want to show the entire text either by opening it in a modal or another page.

Would be nice to have a three dots (or a custom text) by the end of the cut off text and an action (maybe a widget, maybe just a custom text with a custom onTap action). For example:

"This text is way too long because it will only take up to 64 le ... more"

The three dots by the end can be a custom text or icon and the "more" text can have an action to maybe open up some screen that can show the entire text. As mentioned above the "more" can also be a Widget, for possibly an Icon or custom Text.

An alternative for me was to add a button below the trimmed text for the user to open the entire text in a modal.

Version

  • Flutter version: [e.g. 1.5.4]
  • auto_size_text version: [e.g. 1.2.1]
@LeoVen LeoVen added the enhancement New feature or request label Sep 11, 2019
@LeoVen LeoVen changed the title Add a text by the end of the overflowed text and an action Option to add text by the end of the overflowed text and an action Sep 11, 2019
@simc
Copy link
Owner

simc commented Sep 11, 2019

You can achieve all of that using the overflowReplacement parameter.

For example:

AutoSizeText (
  "Some long String",
  overflowReplacement: GestureDetector(
    onTap: () {
      // Open modal
    },
    child: AutoSizeText (
      "Some long String ... more",
    ),
  ),
)

@LeoVen
Copy link
Author

LeoVen commented Sep 11, 2019

Apparently the solution was right under my nose

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants