fromEvent static method

Metadata fromEvent(
  1. Nip01Event event
)

convert from nip01 event

Implementation

static Metadata fromEvent(Nip01Event event) {
  Metadata metadata = Metadata();
  if (Helpers.isNotBlank(event.content)) {
    Map<String, dynamic> json = jsonDecode(event.content);
    metadata = Metadata.fromJson(json);
  }
  metadata.pubKey = event.pubKey;
  metadata.updatedAt = event.createdAt;
  return metadata;
}