And below is my code.
Widget setupListTile(User userdata, int index) {
return new Slidable(
delegate: new SlidableDrawerDelegate(),
actionExtentRatio: 0.25,
child: Column(children: <Widget>[
ListTile(
leading: CircleAvatar(
backgroundColor: Colors.blueAccent,
child: Text(userdata.name[0].toUpperCase(),
style: TextStyle(color: Colors.white)),
),
title: Text('${userdata.name}'),
subtitle: Text(userdata.company.name),
onTap: () {
_showSnackBar("Hey ${userdata.name}, How are you?");
},
),
Divider()
]),
actions: <Widget>[
new IconSlideAction(
caption: 'Archive',
color: Colors.blue,
icon: Icons.archive,
onTap: () => _showSnackBar('Archive'),
),
new IconSlideAction(
caption: 'Share',
color: Colors.indigo,
icon: Icons.share,
onTap: () => _showSnackBar('Share'),
),
],
secondaryActions: <Widget>[
new IconSlideAction(
caption: 'More',
color: Colors.black45,
icon: Icons.more_horiz,
onTap: () => _showSnackBar('More'),
),
new IconSlideAction(
caption: 'Delete',
color: Colors.red,
icon: Icons.delete,
onTap: () => _showSnackBar('Delete'),
),
],
);
}