copyWith method

Document copyWith({
  1. int? id,
  2. String? name,
  3. String? createdAt,
  4. String? url,
  5. String? origUrl,
  6. String? textUrl,
  7. int? dashboardId,
  8. List<Attachment>? attachments,
})

Creates a copy of this document but with the given fields replaced with the new values.

Implementation

Document copyWith({
  int? id,
  String? name,
  String? createdAt,
  String? url,
  String? origUrl,
  String? textUrl,
  int? dashboardId,
  List<Attachment>? attachments,
}) {
  return Document(
    id: id ?? this.id,
    name: name ?? this.name,
    createdAt: createdAt ?? this.createdAt,
    url: url ?? this.url,
    origUrl: origUrl ?? this.origUrl,
    textUrl: textUrl ?? this.textUrl,
    dashboardId: dashboardId ?? this.dashboardId,
    attachments: attachments ?? this.attachments,
  );
}