FirebaseFollowSource class final
FollowDataSource backed by Cloud Firestore.
Follow documents are stored in two sub-collections per user:
users/{userId}/followers/{followerId}— who follows the user.users/{userId}/following/{targetId}— who the user follows.
A root follows collection is also maintained for easy querying.
- Implemented types
Constructors
- FirebaseFollowSource({FirebaseFirestore? firestore})
- Creates a FirebaseFollowSource.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
follow(
{required String followerId, required String targetId}) → Future< void> -
Records that
followerIdis followingtargetId.override -
getFollowers(
String userId, {int? limit}) → Future< List< String> > -
Returns IDs of users following
userId.override -
getFollowing(
String userId, {int? limit}) → Future< List< String> > -
Returns IDs of users that
userIdis following.override -
isFollowing(
{required String followerId, required String targetId}) → Future< bool> -
Returns
truewhenfollowerIdis followingtargetId.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
unfollow(
{required String followerId, required String targetId}) → Future< void> -
Removes the follow relationship from
followerIdtotargetId.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited