copyWith method

Annotations copyWith({
  1. List<Role>? audience,
  2. num? priority,
  3. String? lastModified,
})

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

Implementation

Annotations copyWith({
  List<Role>? audience,
  num? priority,
  String? lastModified,
}) =>
    Annotations.fromJson({
      ...toJson(),
      if (audience != null) 'audience': $encode(audience),
      if (priority != null) 'priority': $encode(priority),
      if (lastModified != null) 'lastModified': $encode(lastModified),
    });