CausalEvent constructor

CausalEvent({
  1. String? id,
  2. String? parentId,
  3. required CausalEventType type,
  4. required String description,
  5. DateTime? timestamp,
  6. Map<String, dynamic>? metadata,
  7. Duration? duration,
})

Implementation

CausalEvent({
  String? id,
  this.parentId,
  required this.type,
  required this.description,
  DateTime? timestamp,
  Map<String, dynamic>? metadata,
  this.duration,
})  : id = id ?? const Uuid().v4(),
      timestamp = timestamp ?? DateTime.now(),
      metadata = metadata ?? const {};