FirestoreService class Services
A service for interacting with Firebase Firestore.
The functions are distributed over mixins to keep the code organized. The mixins for this class are:
- InboxFunctions: For fetching inbox notifications.
- PostFunctions: For interacting with posts.
- ActivityFunctions: For interacting with activities.
- CommentFunctions: For interacting with comments.
- ParticipantFunctions: For interacting with activity participants.
Constructors
- FirestoreService(FirebaseFirestore firestoreInstance)
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- instance ↔ FirebaseFirestore
-
latefinalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
activitiesBetweenTwoDates(
DateTime lowerBound, DateTime upperBound) → Future< List< ActivityModel> > -
Returns a list of activities that are happening between two dates.
inherited
-
activityStream(
) → Stream< QuerySnapshot< ActivityModel> > -
Returns a stream of activities that are happening this month.
inherited
-
addUserToParticipants(
String activityID, String userId, ParticipantType type) → Future< void> -
Adds a user to the participants of an activity.
inherited
-
approvePost(
String id) → Future< void> -
Approves a post with the given
id.inherited -
createComment(
String commentSectionID, CommentModel comment) → Future< void> -
Creates a comment with the given
textanduserID.inherited -
createPost(
PostModel data) → Future< CreatePostResult> -
Creates a post with the given
data.inherited -
deleteActivity(
String id) → Future< CreateActivityResult> -
Deletes an activity with the given
id.inherited -
deleteComment(
String commentSectionID, CommentModel comment) → Future< void> -
Deletes a comment with the given
commentIDandcommentSectionID.inherited -
deletePost(
String id) → Future< void> -
Deletes a post with the given
id.inherited -
editComment(
String commentSectionID, CommentModel comment) → Future< void> -
Edits a comment with the given
text.inherited -
editPost(
PostModel data) → Future< CreatePostResult> -
Edits a post with the given
data.inherited -
getActivity(
String id) → Future< ActivityModel?> -
Returns an activity with the given
id.inherited -
getApprovedPostsQuery(
{void converterCallback(PostModel)?}) → Query< PostModel> -
Returns a stream of approved posts to show in the Feed.
inherited
-
getCommentStream(
String id) → Stream< List< CommentModel> > -
Returns a stream of comments with the given
id.inherited -
getEmptyDocumentID(
) → String -
Returns an empty document ID.
inherited
-
getNotifications(
) → Stream< DocumentSnapshot< List< >InboxNotification> ?> -
Returns a stream of notifications.
inherited
-
getParticipants(
String id) → Future< Map< String, dynamic> ?> -
Returns the participants of an activity with the given
id.inherited -
getPost(
String id) → Future< PostModel?> -
Returns a post with the given
id.inherited -
getRelatedPostsQuery(
String id) → Query< PostModel> -
Disapproves a post with the given
id.inherited -
getSinglePost(
String id) → Future< PostModel?> -
Returns a stream of posts with the given
id.inherited -
getUnapprovedPosts(
) → Future< List< PostModel> > -
Returns a stream of unapproved posts to show in the UnapprovedPostsList.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
parseCommentData(
Map< String, dynamic> ? data) → List<CommentModel> -
Read the document data and convert it to a list of
CommentModelobjects.inherited -
parseNotifications(
DocumentSnapshot< Map< snapshot) → List<String, dynamic> >InboxNotification> ? -
Parses the notifications from the
snapshot.inherited -
setActivity(
ActivityModel data) → Future< CreateActivityResult> -
Sets an activity with the given
data.inherited -
toString(
) → String -
A string representation of this object.
inherited
-
updateActivity(
ActivityModel data) → Future< CreateActivityResult> -
Updates an activity with the given
data.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited