getStatus method

dynamic getStatus(
  1. Iterable<TaskModel> tasks,
  2. List<ProjectBeneficiaryModel> projectBeneficiaries,
  3. bool isNotEligible,
  4. bool isBeneficiaryRefused,
)

Implementation

getStatus(
    Iterable<TaskModel> tasks,
    List<ProjectBeneficiaryModel> projectBeneficiaries,
    bool isNotEligible,
    bool isBeneficiaryRefused) {
  if (projectBeneficiaries.isNotEmpty) {
    if (tasks.isEmpty) {
      return Status.registered.toValue();
    } else {
      return getTaskStatus(tasks.toList()).toValue();
    }
  } else {
    return Status.notRegistered.toValue();
  }
}