holdFillFraction static method

double holdFillFraction(
  1. double t
)

Hold fill progress for a hold value t (0–1 over holdDuration): 0 until holdFillDelay, then linear to 1 at holdDuration.

Implementation

static double holdFillFraction(double t) {
  final total = holdDuration.inMicroseconds;
  final delay = holdFillDelay.inMicroseconds;
  return ((t * total - delay) / (total - delay)).clamp(0.0, 1.0);
}