isEpisodeCompleted function

bool isEpisodeCompleted(
  1. double currentTime,
  2. double duration
)

Implementation

bool isEpisodeCompleted(double currentTime, double duration) {
  final double endingTime =
      duration > minute * 10 ? minute * 3 : duration * 0.2;
  final double timeLeft = duration - currentTime;

  return timeLeft <= endingTime;
}