Closed LeoVen closed 5 years ago
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",
),
),
)
Apparently the solution was right under my nose
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