futures property
Future that resolves to all documents in the collection.
Returns a Future that resolves to a list of all documents once,
without real-time updates. Respects the limit parameter.
Usage
final users = await userCollection.futures;
for (final user in users) {
print('User: ${user.name}');
}
Performance
- More efficient than streams for one-time data fetching
- Use
limitparameter to control data size - Consider pagination for large datasets
Implementation
Future<List<T>> get futures async {
QuerySnapshot snapshots = await _getCollection.limit(limit).get();
return _snapshots(snapshots);
}