Activity class
Represents a single activity with its data and state.
The primary interface for working with individual activities in the Stream Feeds SDK that provides functionality for managing activity data, comments, reactions, and polls with real-time updates.
Each activity instance is associated with a specific activity ID and feed ID, maintaining its own state that can be observed for real-time updates. The activity state includes activity data, comments, and poll information.
- Mixed-in types
Properties
- activitiesRepository → ActivitiesRepository
-
final
- activityId → String
-
final
- commentsRepository → CommentsRepository
-
final
- currentUserId → String
-
final
-
eventsEmitter
→ SharedEmitter<
WsEvent> -
final
- fid → FeedId
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isDisposed → bool
-
Returns
true
if this object has been disposed.no setterinherited -
notifier
→ StateNotifier<
ActivityState> -
no setter
- pollsRepository → PollsRepository
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state → ActivityState
-
no setter
-
stream
→ Stream<
ActivityState> -
no setter
Methods
-
addComment(
{required ActivityAddCommentRequest request}) → Future< Result< CommentData> > - Adds a comment to this activity.
-
addCommentReaction(
{required String commentId, required AddCommentReactionRequest request}) → Future< Result< FeedsReactionData> > - Adds a reaction to a comment.
-
addCommentsBatch(
List< ActivityAddCommentRequest> requests) → Future<Result< List< >CommentData> > - Adds multiple comments to this activity in a batch.
-
castPollVote(
CastPollVoteRequest request) → Future< Result< PollVoteData?> > - Casts a vote on the poll.
-
closePoll(
) → Future< Result< PollData> > - Closes the poll associated with this activity.
-
createPollOption(
CreatePollOptionRequest request) → Future< Result< PollOptionData> > - Creates a new poll option.
-
deleteComment(
String commentId, {bool? hardDelete}) → Future< Result< void> > - Deletes a comment by its ID.
-
deleteCommentReaction(
String commentId, String type) → Future< Result< FeedsReactionData> > - Removes a reaction from a comment.
-
deletePoll(
) → Future< Result< void> > - Deletes the poll associated with this activity.
-
deletePollOption(
{required String optionId}) → Future< Result< void> > - Deletes a poll option by its ID.
-
deletePollVote(
{required String voteId}) → Future< Result< PollVoteData?> > - Deletes a poll vote by its ID.
-
dispose(
) → void -
Disposes of this object.
override
-
get(
) → Future< Result< ActivityData> > - Fetches the activity data from the server.
-
getComment(
String commentId) → Future< Result< CommentData> > - Fetches a specific comment by its ID.
-
getPoll(
) → Future< Result< PollData> > - Fetches the poll associated with this activity.
-
getPollOption(
String optionId) → Future< Result< PollOptionData> > - Fetches a poll option by its ID.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pin(
) → Future< Result< void> > - Pins this activity.
-
queryComments(
) → Future< Result< List< >ThreadedCommentData> > - Queries the comments for this activity.
-
queryMoreComments(
{int? limit}) → Future< Result< List< >ThreadedCommentData> > - Loads more comments for this activity.
-
toString(
) → String -
A string representation of this object.
inherited
-
unpin(
) → Future< Result< void> > - Unpins this activity.
-
updateComment(
String commentId, ActivityUpdateCommentRequest request) → Future< Result< CommentData> > - Updates a comment by its ID.
-
updatePoll(
UpdatePollRequest request) → Future< Result< PollData> > - Updates the poll.
-
updatePollOption(
UpdatePollOptionRequest request) → Future< Result< PollOptionData> > - Updates a poll option.
-
updatePollPartial(
UpdatePollPartialRequest request) → Future< Result< PollData> > - Updates the poll partially.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited