Event.fromJson constructor

Event.fromJson(
  1. Map<String, dynamic> data
)

Implementation

factory Event.fromJson(Map<String, dynamic> data) {
  final id = data['id'] as String;
  final pubKey = data['pubkey'] as String;
  final createdAt = data['created_at'] as int;
  final kind = data['kind'] as int;
  final tags = data['tags'];
  final content = data['content'] as String;
  final sig = data['sig'] as String;

  return Event._(id, pubKey, createdAt, kind, tags, content, sig);
}