BaseEntity constructor

BaseEntity({
  1. required String? id,
  2. String? name,
  3. String? displayName,
  4. String? shortName,
  5. String? lastUpdated,
  6. String? created,
  7. String? code,
  8. required bool dirty,
})

Implementation

BaseEntity(
    {required this.id,
    this.name,
    this.displayName,
    this.shortName,
    this.lastUpdated,
    this.created,
    this.code,
    required this.dirty}) {
  this.id = this.id ?? DhisUidGenerator.generate();
  this.created =
      this.created ?? DateTime.now().toIso8601String().split('.')[0];
  this.lastUpdated = this.lastUpdated ?? this.created;
}