paginateCollection method
Implementation
Future<List<QueryDocumentSnapshot>> paginateCollection(String collectionPath,
{DocumentSnapshot? startAfter, int limit = 10}) async {
Query query = _db.collection(collectionPath).limit(limit);
if (startAfter != null) {
query = query.startAfterDocument(startAfter);
}
QuerySnapshot querySnapshot = await query.get();
return querySnapshot.docs;
}