Reaction class Null safety

The class that defines a reaction

Annotations

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
@JsonKey(includeIfNull: false, toJson: Serializer.readOnly), final
extraData Map<String, Object?>
Reaction custom extraData
@JsonKey(includeIfNull: false), final
hashCode int
The hash code for this object. [...]
read-only, inherited
messageId String?
The messageId to which the reaction belongs
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
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
@JsonKey(includeIfNull: false, toJson: Serializer.readOnly), final
userId String?
The userId that sent the reaction
@JsonKey(includeIfNull: false, toJson: Serializer.readOnly), 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 non-existent 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
['message_id', 'created_at', 'type', 'user', 'user_id', 'score']