flutter / flutter/flutter

Text Overflow.fade for multiline text

Open
#142,614 1 comment 0 reactions 0 assignees View on GitHub
c: new feature c: proposal framework P3 team-framework triaged-framework
Dominant language
Dart
Stars
179k
Forks
31.1k
PR merge metrics
PR metrics pending

Description

### Use case

I am trying to achieve the effect of fading out the block text. I am writing this code:
``` dart
Text(
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. ',
maxLines: 2,
style: TextStyle(
overflow: TextOverflow.fade,
),
),
```
And I get it:
Screenshot 2024-01-31 at 16 21 35

But that's not what I need. I want the text to fade out only on the right side of the last line. That is, the last line should look like this:
Screenshot 2024-01-31 at 16 28 36

### Proposal

I want the text to fade out only on the right side of the last line. That is, the last line should look like this:
Screenshot 2024-01-31 at 16 28 36

Maybe something can be corrected inside Flutter to achieve this behavior?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.