unfollow method
Removes the follow relationship from followerId to targetId.
Implementation
@override
Future<void> unfollow({
required String followerId,
required String targetId,
}) async {
try {
final batch =
_firestore.batch()
..delete(_followersDoc(targetId, followerId))
..delete(_followingDoc(followerId, targetId))
..delete(_followsCollection().doc('${followerId}_$targetId'));
await batch.commit();
} catch (error) {
throw Exception(
'FirebaseFollowSource.unfollow failed '
'($followerId → $targetId): $error',
);
}
}