getProgress method

double getProgress(
  1. Duration totalDuration
)

Get progress value (0.0 to 1.0) based on total duration

Implementation

double getProgress(Duration totalDuration) {
  if (totalDuration.isZero) return 1.0;
  return 1.0 - (inMilliseconds / totalDuration.inMilliseconds);
}