copyWith method

TaskMetadata copyWith({
  1. int? ttl,
})

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

Implementation

TaskMetadata copyWith({
  int? ttl,
}) =>
    TaskMetadata.fromJson({
      ...toJson(),
      if (ttl != null) 'ttl': $encode(ttl),
    });