Reaction.fromMap constructor

Reaction.fromMap(
  1. dynamic map
)

Creates a new Reaction instance from a map.

Implementation

factory Reaction.fromMap(dynamic map) {
  if (map == null) {
    throw ArgumentError('The type of message reaction map is null');
  }
  return Reaction(
      id: map['id'] ?? '',
      messageId: map['messageId'] ?? null,
      reaction: map['reaction'],
      uid: map['uid'],
      reactedAt: map['reactedAt'],
      reactedBy:
          map['reactedBy'] != null ? User.fromMap(map['reactedBy']) : null);
}