getPhaseProgress method

double getPhaseProgress()

Obtiene el progreso de la fase actual (0-1)

Implementation

double getPhaseProgress() {
  double phaseDuration;
  switch (phase) {
    case BreathingPhase.inhale:
      phaseDuration = inhaleTime;
      break;
    case BreathingPhase.holdIn:
      phaseDuration = holdInTime;
      break;
    case BreathingPhase.exhale:
      phaseDuration = exhaleTime;
      break;
    case BreathingPhase.holdOut:
      phaseDuration = holdOutTime;
      break;
  }
  return (_phaseTimer / phaseDuration).clamp(0.0, 1.0);
}