copyWith method

PendingMessage copyWith({
  1. bool? failed,
  2. String? errorCode,
  3. bool clearError = false,
  4. List<String>? attachments,
  5. PendingUpload? upload,
})

Copies with some fields replaced.

Implementation

PendingMessage copyWith({
  bool? failed,
  String? errorCode,
  bool clearError = false,
  List<String>? attachments,
  PendingUpload? upload,
}) => PendingMessage(
  clientId: clientId,
  content: content,
  createdAt: createdAt,
  attachments: attachments ?? this.attachments,
  upload: upload ?? this.upload,
  failed: failed ?? this.failed,
  errorCode: clearError ? null : (errorCode ?? this.errorCode),
);