progressFor method

double progressFor(
  1. int index
)

How far through its entrance the character at index is, 0 to 1.

Implementation

double progressFor(int index) {
  if (index < _settledBelow) {
    return 1;
  }
  if (index >= _revealed.floor()) {
    return 0;
  }
  if (fadeSeconds <= 0) {
    return 1;
  }
  // Older than the ring can hold, so certainly finished.
  if (index < _revealed.floor() - fadeWindow) {
    return 1;
  }
  final elapsed = _clock - _stamps[index & _mask];
  return (elapsed / fadeSeconds).clamp(0.0, 1.0);
}