Metadata class

basic nostr metadata

Constructors

Metadata({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<List<String>>? tags, Map<String, dynamic>? content})
basic metadata nostr
Metadata.fromJson(Map<String, dynamic> json)
convert from json (all Metadata fields)

Properties

about String?
about
getter/setter pair
banner
getter/setter pair
cleanNip05 String?
clean nip05
no setter
content Map<String, dynamic>
content JSON to preserve custom fields
getter/setter pair
displayName String?
displayName
getter/setter pair
hashCode int
The hash code for this object.
no setteroverride
lud06 String?
lud06
getter/setter pair
lud16 String?
lud16
getter/setter pair
name String?
name
getter/setter pair
nip05 String?
nip05
getter/setter pair
picture String?
picture
getter/setter pair
pubKey String
public key
getter/setter pair
refreshedTimestamp int?
refreshed timestamp
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sources List<String>
getter/setter pair
tags List<List<String>>
event tags (e.g., NIP-39 identity tags)
getter/setter pair
updatedAt int?
updated at
getter/setter pair
website String?
website
getter/setter pair

Methods

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, List<List<String>>? tags, Map<String, dynamic>? content}) Metadata
getCustomField(String key) → dynamic
Get a custom field from the content
getName() String
return display name if set, otherwise name if set, otherwise pubKey
matchesSearch(String str) bool
does it match while searching for given string
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setCustomField(String key, dynamic value) → void
Set a custom field in the content Works for both known fields (name, display_name, etc.) and custom fields
toEvent() Nip01Event
convert to nip01 event
toJson() Map<String, dynamic>
convert to json (all Metadata fields, only non-null/non-empty)
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override

Static Methods

fromEvent(Nip01Event event) Metadata
convert from nip01 event

Constants

kKind → const int