copyWith method

CompletedTask copyWith({
  1. String? taskId,
  2. String? statusMessage,
  3. String? createdAt,
  4. String? lastUpdatedAt,
  5. Object? ttlMs = absent,
  6. int? pollIntervalMs,
  7. Map<String, Object?>? result,
})

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

Implementation

CompletedTask copyWith({
  String? taskId,
  String? statusMessage,
  String? createdAt,
  String? lastUpdatedAt,
  Object? ttlMs = absent,
  int? pollIntervalMs,
  Map<String, Object?>? result,
}) =>
    CompletedTask.fromJson({
      ...toJson(),
      if (taskId != null) 'taskId': $encode(taskId),
      if (statusMessage != null) 'statusMessage': $encode(statusMessage),
      if (createdAt != null) 'createdAt': $encode(createdAt),
      if (lastUpdatedAt != null) 'lastUpdatedAt': $encode(lastUpdatedAt),
      if (!identical(ttlMs, absent)) 'ttlMs': $encode(ttlMs),
      if (pollIntervalMs != null) 'pollIntervalMs': $encode(pollIntervalMs),
      if (result != null) 'result': $encode(result),
    });