EventFractal constructor

EventFractal({
  1. int? id,
  2. String hash = '',
  3. String? pubkey,
  4. int? createdAt,
  5. String content = '',
  6. int syncAt = 0,
  7. NodeFractal<EventFractal>? owner,
  8. String sig = '',
  9. EventFractal? to,
  10. FKind kind = FKind.basic,
})

Implementation

EventFractal({
  super.id,
  String hash = '',
  String? pubkey,
  int? createdAt,
  this.content = '',
  this.syncAt = 0,
  NodeFractal? owner,
  this.sig = '',
  EventFractal? to,
  super.kind,
}) {
  super.to = to;
  if (this is! Attr /*&& this is! ClientFractal*/) {
    this.owner = owner ?? UserFractal.active.value ?? DeviceFractal.my;
  }

  syncAt = to?.decideSync ?? 1;

  this.hash = hash;
  this.pubkey = pubkey ?? _myKeyPair?.publicKey ?? '';
  if (createdAt == null) this.createdAt = unixSeconds;

  _construct();
  //ownerC.complete(owner);
  construct();
}