copyWith method
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),
);