Skip to content

Improve the ListTile docs: explain the Text maxLines dependency #15423

Description

@kylegoetz

Flutter beta.

Docs say ListTiles are all the same height, and all 1–3 lines high. When I build ListTiles with subtitle property containing a very length Text object, those ListTiles are wayyyy taller than three lines and certainly not of equal height like the docs say they're supposed to (even if you construe "three lines" as "three spans of text separated by \n".

See screenshot. These are two ListTiles.

screen shot 2018-03-11 at 23 07 49

Relevant code:

    new ListView(
        shrinkWrap: true,
        scrollDirection: Axis.vertical,
        ListTile.divideTiles(
            color: Colors.deepOrange,
            tiles: items.map((item) {
                return _buildRow(item);
            }).toList()
        ).toList()
    )

    Widget _buildRow(Item item) {
        return new Dismissible(
            key: new Key(item.id.toString()),
            //...
            child: new Padding(
                child: new ListTile(
                    title: new Text(item.title),
                    subtitle: new Text(item.content),
                    textAlign: TextAlign.justify
                )
                //...
            )
        );
    }

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work lista: qualityA truly polished experienced: api docsIssues with https://api.flutter.dev/f: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.waiting for PR to land (fixed)A fix is in flight

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions