copyWith method

Task copyWith({
  1. String? createdAt,
  2. String? lastUpdatedAt,
  3. int? pollInterval,
  4. TaskStatus? status,
  5. String? statusMessage,
  6. String? taskId,
  7. Object? ttl = absent,
  8. Object? ttlMs = absent,
  9. int? pollIntervalMs,
})

A copy with the given properties replaced; everything else, unknown keys included, is kept.

Implementation

Task copyWith({
  String? createdAt,
  String? lastUpdatedAt,
  int? pollInterval,
  TaskStatus? status,
  String? statusMessage,
  String? taskId,
  Object? ttl = absent,
  Object? ttlMs = absent,
  int? pollIntervalMs,
}) =>
    Task.fromJson({
      ...toJson(),
      if (createdAt != null) 'createdAt': $encode(createdAt),
      if (lastUpdatedAt != null) 'lastUpdatedAt': $encode(lastUpdatedAt),
      if (pollInterval != null) 'pollInterval': $encode(pollInterval),
      if (status != null) 'status': $encode(status),
      if (statusMessage != null) 'statusMessage': $encode(statusMessage),
      if (taskId != null) 'taskId': $encode(taskId),
      if (!identical(ttl, absent)) 'ttl': $encode(ttl),
      if (!identical(ttlMs, absent)) 'ttlMs': $encode(ttlMs),
      if (pollIntervalMs != null) 'pollIntervalMs': $encode(pollIntervalMs),
    });