PostFunctions class abstract mixin

A mixin that contains functions for managing posts.

The functions are used in the FirestoreService class. You can call functions from this mixin as follows:

ref.read(firestoreServiceProvider).getApprovedPostsQuery();
Implementers

Constructors

PostFunctions()

Properties

hashCode int
The hash code for this object.
no setterinherited
instance FirebaseFirestore
latefinal
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

approvePost(String id) Future<void>
Approves a post with the given id.
createPost(PostModel data) Future<CreatePostResult>
Creates a post with the given data.
deletePost(String id) Future<void>
Deletes a post with the given id.
editPost(PostModel data) Future<CreatePostResult>
Edits a post with the given data.
getApprovedPostsQuery({void converterCallback(PostModel)?}) Query<PostModel>
Returns a stream of approved posts to show in the Feed.
getPost(String id) Future<PostModel?>
Returns a post with the given id.
getRelatedPostsQuery(String id) Query<PostModel>
Disapproves a post with the given id.
getSinglePost(String id) Future<PostModel?>
Returns a stream of posts with the given id.
getUnapprovedPosts() Future<List<PostModel>>
Returns a stream of unapproved posts to show in the UnapprovedPostsList.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited