checkIfBeneficiaryReferred function

bool checkIfBeneficiaryReferred(
  1. List<ReferralModel>? referrals,
  2. ProjectCycle? currentCycle
)

Implementation

bool checkIfBeneficiaryReferred(
  List<ReferralModel>? referrals,
  ProjectCycle? currentCycle,
) {
  if (currentCycle?.startDate != null && currentCycle?.endDate != null) {
    final isBeneficiaryReferred = (referrals != null &&
        (referrals ?? []).isNotEmpty &&
        referrals.last.clientAuditDetails!.createdTime >=
            currentCycle!.startDate &&
        referrals.last.clientAuditDetails!.createdTime <= currentCycle.endDate);

    return isBeneficiaryReferred;
  } else {
    return false;
  }
}