Reaction constructor

Reaction({
  1. String? messageId,
  2. DateTime? createdAt,
  3. required String type,
  4. User? user,
  5. String? userId,
  6. int score = 0,
  7. Map<String, Object?> extraData = const {},
})

Constructor used for json serialization

Implementation

Reaction({
  this.messageId,
  DateTime? createdAt,
  required this.type,
  this.user,
  String? userId,
  this.score = 0,
  this.extraData = const {},
})  : userId = userId ?? user?.id,
      createdAt = createdAt ?? DateTime.now();