CustomMessage.fromPartial constructor

CustomMessage.fromPartial({
  1. required User author,
  2. int? createdAt,
  3. required String id,
  4. required PartialCustom partialCustom,
  5. String? remoteId,
  6. String? roomId,
  7. bool? showStatus,
  8. Status? status,
  9. int? updatedAt,
  10. bool? isEdited,
  11. bool? isDeleted,
  12. Map<String, String>? reactions,
})

Creates a full custom message from a partial one.

Implementation

factory CustomMessage.fromPartial({
  required User author,
  int? createdAt,
  required String id,
  required PartialCustom partialCustom,
  String? remoteId,
  String? roomId,
  bool? showStatus,
  Status? status,
  int? updatedAt,
  bool? isEdited,
  bool? isDeleted,
  Map<String, String>? reactions,
}) =>
    _CustomMessage(
      author: author,
      createdAt: createdAt,
      id: id,
      metadata: partialCustom.metadata,
      remoteId: remoteId,
      repliedMessage: partialCustom.repliedMessage,
      roomId: roomId,
      showStatus: showStatus,
      status: status,
      type: MessageType.custom,
      updatedAt: updatedAt,
      isEdited: isEdited ?? false,
      isDeleted: isDeleted ?? false,
      reactions: reactions ?? const {},
    );