checkMileStoneCompleted method

bool checkMileStoneCompleted(
  1. String challengeId,
  2. String milestoneId
)

Implementation

bool checkMileStoneCompleted(String challengeId, String milestoneId) {
  bool? check = _userData
              .where((element) => element.challengeId == challengeId)
              .isEmpty ||
          _userData
              .where((element) => element.challengeId == challengeId)
              .first
              .milestonesData!
              .where((element) => element.milestoneId == milestoneId)
              .isEmpty
      ? false
      : _userData
          .where((element) => element.challengeId == challengeId)
          .first
          .milestonesData!
          .where((element) => element.milestoneId == milestoneId)
          .first
          .isCompleted;
  return check ?? false;
}