Reaction class

The class that defines a reaction

Annotations
  • @JsonSerializable()

Constructors

Reaction({String? messageId, DateTime? createdAt, required String type, User? user, String? userId, int score = 0, Map<String, Object?> extraData = const {}})
Constructor used for json serialization
Reaction.fromJson(Map<String, dynamic> json)
Create a new instance from a json
factory

Properties

createdAt DateTime
The date of the reaction
final
extraData Map<String, Object?>
Reaction custom extraData
final
hashCode int
The hash code for this object.
no setterinherited
messageId String?
The messageId to which the reaction belongs
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
score int
The score of the reaction (ie. number of reactions sent)
final
type String
The type of the reaction
final
user User?
The user that sent the reaction
final
userId String?
The userId that sent the reaction
final

Methods

copyWith({String? messageId, DateTime? createdAt, String? type, User? user, String? userId, int? score, Map<String, Object?>? extraData}) Reaction
Creates a copy of Reaction with specified attributes overridden.
merge(Reaction other) Reaction
Returns a new Reaction that is a combination of this reaction and the given other reaction.
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>
Map of custom user extraData