Skip to content

TextOverflow.fade results in unexpected fade direction #13631

@mehmetf

Description

@mehmetf
import 'package:flutter/material.dart';

void main() {
  runApp(new FadeDemo());
}

class FadeDemo extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    var themeData = new ThemeData();
    return new MaterialApp(
        theme: themeData,
        home: new Scaffold(
          appBar: new AppBar(title: const Text('Fade Effect')),
          body: new Center(
            child: new Container(
              color: Colors.grey[300],
              width: 250.0,
              child: new Text(
                'This is a short text.',
                style: themeData.textTheme.title.copyWith(fontSize: 48.0),
                maxLines: 1,
                overflow: TextOverflow.fade,
              ),
            ),
          ),
        ));
  }
}

results in:

image

I was expecting it to fade out horizontally. If I set overflow to ellipsis, it works as expected and puts the ellipsis at the end.

If I turn off softwrap, fade works as expected. That's counterintuitive given that I would have expected softwrap to have no effect because of maxLines: 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listd: api docsIssues with https://api.flutter.dev/frameworkflutter/packages/flutter repository. See also f: labels.r: fixedIssue is closed as already fixed in a newer versionteam-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

    Issue actions