LikeStore class abstract
Like related interfaces, managing like sending, like state synchronization, and like event listening operations in live rooms/voice chat rooms.
LikeStore Like management class for handling like-related business logic in live rooms/voice chat rooms.
LikeStore provides a complete set of like management APIs, including sending likes, listening to like events, and getting like states. Through this class, you can implement like interaction features in live rooms.
Key Features
- Like Sending:Support sending likes to the current room
- Like State:Get the accumulated like count of the current room
- Event Listening:Listen to like receiving events
Important: Use the create factory method to create a
LikeStoreinstance, which requires a valid live room ID.
Note: Like state updates are delivered through the likeState publisher. Subscribe to it to receive real-time updates of like data in the room.
Like Operations Overview
| Operation | Method | Description |
|---|---|---|
| Send Like | sendLike | Send likes to the current room |
| Get State | likeState | Get the like state of the current room |
| Add Listener | addLikeListener | Add like event listener |
| Remove Listener | removeLikeListener | Remove like event listener |
Topics
Creating Instance
- create - Create like management instance
Observing State and Events
- likeState - Like state of the current room
- addLikeListener/removeLikeListener - Like event callbacks
Like Operations
- sendLike - Send likes
See Also
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- likeState → LikeState
-
Like state subscription for the current room, containing information such as accumulated like count. By subscribing to this state, you can get real-time updates of like data in the room.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addLikeListener(
LikeListener listener) → void - Add like event listener
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeLikeListener(
LikeListener listener) → void - Remove like event listener
-
sendLike(
int count) → Future< CompletionHandler> - Send likes to the current room. All users who have subscribed to like events will receive this like notification.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited