【问题标题】:how to remove list tile separator flutter如何删除列表磁贴分隔符抖动
【发布时间】:2022-12-09 20:13:21
【问题描述】:

我想删除列表图块项下的行,如图所示:

.. 请注意,我的列表图块没有 ListView 这是我的代码:

   ListTile(

 leading: ClipRRect(borderRadius: BorderRadius.circular(50),child:Image.memory(base64Decode(society['image'])
   title: Text(society['Society_Name']   ),),
  trailing: ElevatedButton(onPressed: (){
  }, child: Icon(Icons.email_outlined, size: 25,), style: ElevatedButton.styleFrom(backgroundColor: green),),
  ),

【问题讨论】:

  • 图片不显示,请添加正确的图片
  • 对不起,我已经编辑了问题

标签: flutter dart


【解决方案1】:

要删除ListTile 项下的行,您可以将dense 属性设置为true。这将删除该行并降低ListTile 的高度,如果您试图在有限空间内显示大量项目,这可能是您想要的。

以下是如何执行此操作的示例:

ListTile(
  dense: true,  // set this property to true
  leading: ClipRRect(
    borderRadius: BorderRadius.circular(50),
    child: Image.memory(base64Decode(society['image'])
  ),
  title: Text(society['Society_Name']),
  trailing: ElevatedButton(
    onPressed: (){
      // button press code
    },
    child: Icon(Icons.email_outlined, size: 25,),
    style: ElevatedButton.styleFrom(backgroundColor: green),
  ),
),

【讨论】:

  • 对我不起作用
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2019-10-23
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-06-02
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多