copyWith method

CommentViewModel copyWith({
  1. int? id,
  2. String? body,
  3. int? entityId,
  4. CommentType? entityType,
  5. UserViewModel? user,
  6. DateTime? updatedAt,
  7. DateTime? createdAt,
})

Implementation

CommentViewModel copyWith(
    {int? id,
    String? body,
    int? entityId,
    enums.CommentType? entityType,
    UserViewModel? user,
    DateTime? updatedAt,
    DateTime? createdAt}) {
  return CommentViewModel(
      id: id ?? this.id,
      body: body ?? this.body,
      entityId: entityId ?? this.entityId,
      entityType: entityType ?? this.entityType,
      user: user ?? this.user,
      updatedAt: updatedAt ?? this.updatedAt,
      createdAt: createdAt ?? this.createdAt);
}