Activity class

In its simplest form, an activity consists of an actor, a verb, an object, and a target.

It tells the story of a person performing an action on or with an object -- "Geraldine posted a photo to her album" or "John shared a video". In most cases these components will be explicit, but they may also be implied.

Read more about Activities here and here.

Annotations
  • @JsonSerializable()
  • @DateTimeUTCConverter()

Constructors

Activity({required String? actor, required String? verb, required String? object, String? id, String? foreignId, String? target, DateTime? time, List<FeedId>? to, Map<String, Object>? analytics, Map<String, Object>? extraContext, String? origin, double? score, Map<String, Object>? extraData})
Builds an Activity.
const
Activity.fromJson(Map<String, dynamic>? json)
Create a new Activity instance from a JSON object.
factory

Properties

actor String?
Describes the entity that performed the activity.
final
analytics Map<String, Object>?
This allows you to gain a better understanding of that user's interests. Common examples include:
final
extraContext Map<String, Object>?
extra context data to be used by the application.
final
extraData Map<String, Object>?
Map of custom user extraData
final
foreignId String?
A unique ID from your application for this activity.
final
hashCode int
The hash code for this object.
no setterinherited
id String?
Provides a permanent, universally unique identifier for the activity in the form of an absolute IRI.
final
object String?
Describes the primary object of the activity.
final
origin String?
The origin of the activity. i.e. where the actor came from.
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
score double?
The score of the activity to indicate the importance of the activity.
final
stringify bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited
target String?
Describes the target of the activity.
final
time DateTime?
The optional time of the activity
final
to List<FeedId>?
The recipients of the action.
final
verb String?
Identifies the action that the activity describes.
final

Methods

copyWith({String? id, String? actor, String? verb, String? object, String? foreignId, String? target, DateTime? time, String? origin, List<FeedId>? to, double? score, Map<String, Object>? analytics, Map<String, Object>? extraContext, Map<String, Object>? extraData}) Activity
Copies this Activity 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. Useful for Serializer methods.