toMap method

Map<String, dynamic> toMap()

Returns a map representation of this event.

Implementation

Map<String, dynamic> toMap() {
  return {
     if (id != null) 'id': id,
    if (kind != null) 'kind': kind,
     'pubkey': pubkey,
    if (content != null) 'content': content,
    if (sig != null) 'sig': sig,
    if (createdAt != null) 'created_at': createdAt!.millisecondsSinceEpoch ~/ 1000,
    if (tags != null) 'tags': tags!.map((tag) => tag.map((e) => e).toList()).toList(),
    };
}