Reaction class
Reactions are a special kind of data that can be used to capture user interaction with specific activities.
Common examples of reactions are likes, comments, and upvotes.
Reactions are automatically returned to feeds' activities at read time when the reactions parameters are used.
- Annotations
-
- @JsonSerializable()
- @DateTimeUTCConverter()
Constructors
-
Reaction({String? id, String? kind, String? activityId, String? userId, String? parent, DateTime? createdAt, DateTime? updatedAt, List<
FeedId> ? targetFeeds, User? user, Map<String, Object> ? targetFeedsExtraData, Map<String, Object> ? data, Map<String, List< ? latestChildren, Map<Reaction> >String, List< ? ownChildren, Map<Reaction> >String, int> ? childrenCounts}) -
Builds a Reaction.
const
-
Reaction.fromJson(Map<
String, dynamic> json) -
Create a new instance from a JSON object
factory
Properties
- activityId → String?
-
The ID of the activity the reaction refers to.
final
-
childrenCounts
→ Map<
String, int> ? -
Child reaction count, grouped by reaction kind
final
- createdAt → DateTime?
-
When the reaction was created.
final
-
data
→ Map<
String, Object> ? -
Additional data to attach to the reaction
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String?
-
Reaction ID
final
- kind → String?
-
The type of reaction (eg. like, comment, ...).
final
-
latestChildren
→ Map<
String, List< ?Reaction> > -
Children reactions, grouped by reaction type.
final
-
ownChildren
→ Map<
String, List< ?Reaction> > -
Children reactions, grouped by reaction type.
final
- parent → String?
-
ID of the parent reaction.
final
-
props
→ List<
Object?> -
The list of properties that will be used to determine whether
two instances are equal.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stringify → bool?
-
If set to
true
, the toString method will be overridden to output this instance's props.no setterinherited -
targetFeeds
→ List<
FeedId> ? -
The feeds that should receive a notification activity
final
-
targetFeedsExtraData
→ Map<
String, Object> ? -
Additional data to attach to the notification activities
final
- updatedAt → DateTime?
-
When the reaction was last updated.
final
- user → User?
-
User of the reaction
final
- userId → String?
-
user_id
of the reaction.final
Methods
-
copyWith(
{String? id, String? kind, String? activityId, String? userId, String? parent, DateTime? createdAt, DateTime? updatedAt, List< FeedId> ? targetFeeds, User? user, Map<String, Object> ? targetFeedsExtraData, Map<String, Object> ? data, Map<String, List< ? latestChildren, Map<Reaction> >String, int> ? childrenCounts, Map<String, List< ? ownChildren}) → ReactionReaction> > - Copies this Reaction to a new instance.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Serialize to json
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
-
topLevelFields
→ const List<
String> - Known top level fields.