copyWith method

Metadata copyWith({
  1. String? pubKey,
  2. String? name,
  3. String? displayName,
  4. String? picture,
  5. String? banner,
  6. String? website,
  7. String? about,
  8. String? nip05,
  9. String? lud16,
  10. String? lud06,
  11. int? updatedAt,
  12. int? refreshedTimestamp,
  13. List<String>? sources,
})

Implementation

Metadata copyWith({
  String? pubKey,
  String? name,
  String? displayName,
  String? picture,
  String? banner,
  String? website,
  String? about,
  String? nip05,
  String? lud16,
  String? lud06,
  int? updatedAt,
  int? refreshedTimestamp,
  List<String>? sources,
}) {
  Metadata metadata = Metadata(
    pubKey: pubKey ?? this.pubKey,
    name: name ?? this.name,
    displayName: displayName ?? this.displayName,
    picture: picture ?? this.picture,
    banner: banner ?? this.banner,
    website: website ?? this.website,
    about: about ?? this.about,
    nip05: nip05 ?? this.nip05,
    lud16: lud16 ?? this.lud16,
    lud06: lud06 ?? this.lud06,
    updatedAt: updatedAt ?? this.updatedAt,
    refreshedTimestamp: refreshedTimestamp ?? this.refreshedTimestamp,
  );

  metadata.sources = sources ?? List.from(this.sources);
  return metadata;
}