Closed kiloki-official closed 2 years ago
Hi @kiloki-official. Now with v1.0.3, you can access the previous or next document snapshot from the itemBuilder
like this
itemBuilder: (context, documentSnapshots, index) {
final data = documentSnapshots[index].data() as Map?;
final previous = documentSnapshots[index - 1].data() as Map?;
// If index is not the last index of the documentSnapshots
final next = documentSnapshots[index + 1].data() as Map?;
return ListTile(
leading: const CircleAvatar(child: Icon(Icons.person)),
title: Text(data['name']),
subtitle: Text(documentSnapshots[index].id),
);
},
Hi, is it possible to access next DocumentSnapshot from the builder ?
I can do it using a streamsubscription, but I'd rather access it through your package.
Thanks