Enrollment constructor

Enrollment({
  1. String? id,
  2. String? name,
  3. String? created,
  4. String? lastUpdated,
  5. String? enrollment,
  6. String? incidentDate,
  7. String? enrollmentDate,
  8. required String trackedEntityType,
  9. required String orgUnit,
  10. required String program,
  11. required bool dirty,
  12. String? status,
  13. bool? synced,
  14. bool? syncFailed,
  15. EnrollmentImportSummary? lastSyncSummary,
  16. Geometry? geometry,
  17. String? lastSyncDate,
  18. List<Event>? events,
  19. dynamic trackedEntityInstance,
})

Implementation

Enrollment(
    {String? id,
    String? name,
    String? created,
    String? lastUpdated,
    this.enrollment,
    this.incidentDate,
    this.enrollmentDate,
    required this.trackedEntityType,
    required this.orgUnit,
    required this.program,
    required bool dirty,
    this.status,
    this.synced,
    this.syncFailed,
    this.lastSyncSummary,
    this.geometry,
    this.lastSyncDate,
    this.events,
    this.trackedEntityInstance})
    : super(
          id: id,
          name: name,
          created: created,
          lastUpdated: lastUpdated,
          dirty: dirty) {
  this.enrollment = this.enrollment ?? this.id;
  this.name = this.name ?? this.enrollment;
  this.incidentDate = this.incidentDate ?? this.created;
  this.enrollmentDate = this.enrollmentDate ?? this.created;
}