toPosition method

double toPosition(
  1. Instant at
)

An instant's position, in nominal slots from the start, clamped to the axis.

Implementation

double toPosition(Instant at) {
  final s = start.epochMilliseconds;
  final ms = at.epochMilliseconds.clamp(s, end.epochMilliseconds);
  return (ms - s) / _unitMs;
}