getFollowing method
Returns IDs of users that userId is following.
Implementation
@override
Future<List<String>> getFollowing(String userId, {int? limit}) async {
try {
var query = _followingCollection(
userId,
).orderBy('createdAt', descending: true);
if (limit != null) query = query.limit(limit);
final snap = await query.get();
return snap.docs.map((d) => d.id).toList(growable: false);
} catch (error) {
throw Exception(
'FirebaseFollowSource.getFollowing failed for "$userId": $error',
);
}
}