Datum constructor Null safety

Datum(
  1. {bool multiDatum = false}
)

Create a datum.

If multiDatum is true, then multiple Datum objects are stored in a list with the same id and header.

Implementation

Datum({bool multiDatum = false}) : super() {
  // add a timestamp to each datum if part of a list of many
  timestamp = (multiDatum) ? DateTime.now().toUtc() : null;
  // only add an id to single datums - not to each multi-datum
  id = (!multiDatum) ? Uuid().v1() : null;
}