Event constructor

Event({
  1. required String type,
  2. Map<String, String>? metadata,
  3. int createTimestamp = 0,
  4. Map<String, dynamic>? payload,
  5. String? data,
})

Implementation

Event({
  required this.type,
  this.metadata,
  this.createTimestamp = 0,
  this.payload,
  this.data,
}) {
  if (createTimestamp == 0) {
    createTimestamp = DateTime.now().millisecondsSinceEpoch ~/ 1000;
  }
}