I use flutter_slidable: ^0.6.0.
I hope working only one item slidable in my listview.
if one item slide by user, all the others(whatever open or close) r closed.
some docs say use key.but mine is not working.
return ListView.builder(
physics: ClampingScrollPhysics(),
itemCount: snapshot.data!.size,
shrinkWrap: true,
itemBuilder: (BuildContext context, count) {
return Padding(
padding: const EdgeInsets.all(8.0),
child: Slidable(
key: Key(snapshot.data!.docs[count].id),
controller: slidableController,
actionPane: SlidableDrawerActionPane(),
actionExtentRatio: 0.25,
actions: <Widget>[
widget.pin == 0
? IconSlideAction(
caption: 'pin 제거',
color: Colors.black45,
icon: Icons.push_pin_rounded,
onTap: () {
pinEraseRoom(widget.roomId);
},
)
: IconSlideAction(
caption: 'Pin',
color: Colors.black45,
icon: Icons.push_pin_outlined,
onTap: () {
pinRoom(widget.roomId);
},
),
],
secondaryActions: <Widget>[
IconSlideAction(
caption: 'Delete',
color: Colors.red,
icon: Icons.delete,
onTap: () {
deleteRoom(widget.roomId);
},
),
],