isFollowing method

  1. @override
Future<bool> isFollowing({
  1. required String followerId,
  2. required String targetId,
})
override

Returns true when followerId is following targetId.

Implementation

@override
Future<bool> isFollowing({
  required String followerId,
  required String targetId,
}) async {
  try {
    final doc = await _followingDoc(followerId, targetId).get();
    return doc.exists;
  } catch (error) {
    throw Exception(
      'FirebaseFollowSource.isFollowing failed '
      '($followerId → $targetId): $error',
    );
  }
}