小编Sim*_*mou的帖子

Flutter:使字幕文本扩展到前导widget下的空白区域

我有一个ListViewin flutter,ListTile里面有s 作为项目。前导小部件是圆形头像,标题是短文本,副标题是长文本。我希望字幕的文本在圆形头像下方的区域中展开,换句话说,我不希望圆形头像下方的阅读为空白。检查下面的图片:就像这里显示的一样

这是我的 ListTile 代码:

class _MessagesListTile extends StatefulWidget {
  _MessagesListTile({
    Key key,
    this.index,
  }) : super(key: key);

  final int index;
  bool isTapped = false;

  @override
  __MessagesListTileState createState() => __MessagesListTileState();
}

class __MessagesListTileState extends State<_MessagesListTile> {
  @override
  Widget build(BuildContext context) {
    return ListTile(
      leading: CircleAvatar(
        child: Image(image: AssetImage("assets/ic_female.png")),
        radius: 30.0,
      ),
      title: Text(
        "Sender ${widget.index}",
        style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16.0),
      ),
      subtitle: Text(
        "A very long message cropped to fit just this area and not …
Run Code Online (Sandbox Code Playgroud)

flutter

6
推荐指数
1
解决办法
112
查看次数

标签 统计

flutter ×1