copyWith method

ChatMessage copyWith({
  1. String? id,
  2. MessageType? type,
  3. String? fromId,
  4. String? fromName,
  5. String? toId,
  6. String? toName,
  7. String? text,
  8. String? roomId,
  9. MessageOriginality? originality,
  10. String? attachment,
  11. String? thumbnail,
  12. String? originalId,
  13. String? originalMessage,
  14. int? sendTime,
  15. int? size,
  16. String? mime,
  17. double? longitude,
  18. double? latitude,
})

Implementation

ChatMessage copyWith(
    {String? id,
    MessageType? type,
    String? fromId,
    String? fromName,
    String? toId,
    String? toName,
    String? text,
    String? roomId,
    MessageOriginality? originality,
    String? attachment,
    String? thumbnail,
    String? originalId,
    String? originalMessage,
    int? sendTime,
    int? size,
    String? mime,
    double? longitude,
    double? latitude}) {
  return ChatMessage(
      id: id ?? this.id,
      type: type ?? this.type,
      fromId: fromId ?? this.fromId,
      fromName: fromName ?? this.fromName,
      toId: toId ?? this.toId,
      toName: toName ?? this.toName,
      text: text ?? this.text,
      roomId: roomId ?? this.roomId,
      originality: originality ?? this.originality,
      attachment: attachment ?? this.attachment,
      thumbnail: thumbnail ?? this.thumbnail,
      originalId: originalId ?? this.originalId,
      originalMessage: originalMessage ?? this.originalMessage,
      sendTime: sendTime ?? this.sendTime,
      size: size ?? this.size,
      mime: mime ?? this.mime,
      longitude: longitude ?? this.longitude,
      latitude: latitude ?? this.latitude);
}