recordedSideEffect function

bool recordedSideEffect(
  1. ProjectCycle? selectedCycle,
  2. TaskModel? task,
  3. List<SideEffectModel>? sideEffects
)

Implementation

bool recordedSideEffect(
  ProjectCycle? selectedCycle,
  TaskModel? task,
  List<SideEffectModel>? sideEffects,
) {
  if (selectedCycle != null &&
      selectedCycle.startDate != null &&
      selectedCycle.endDate != null) {
    if ((task != null) && (sideEffects ?? []).isNotEmpty) {
      final lastTaskCreatedTime =
          task.clientReferenceId == sideEffects?.last.taskClientReferenceId
              ? task.clientAuditDetails?.createdTime
              : null;

      return lastTaskCreatedTime != null &&
          lastTaskCreatedTime >= selectedCycle.startDate &&
          lastTaskCreatedTime <= selectedCycle.endDate;
    }
  }

  return false;
}