gpt4 book ai didi

mobile - Flutter listview.separator item 点击

转载 作者:IT王子 更新时间:2023-10-29 07:08:31 26 4
gpt4 key购买 nike

我正在创建一个 flutter 项目。我想在项目上添加 clicklistener。但我不知道该怎么做。这是我的 ListView.separator 函数

ListView.separated(
itemCount: _listChat.length,
itemBuilder:
(context, index)=>Container(
child: _chatItem(_listChat[index] ),
),
separatorBuilder: (context, index)=>Divider(
color: Colors.black12,
),
),

如果有人有方法,我会很乐意使用它。

最佳答案

ListView.separated(
itemCount: _listChat.length,
itemBuilder:
(context, index)=>InkWell(onTap: () {}, child: Container(
child: _chatItem(_listChat[index] )),
),
separatorBuilder: (context, index)=>Divider(
color: Colors.black12,
),
),

关于mobile - Flutter listview.separator item 点击,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54525208/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com