addPosition method Null safety

void addPosition(
  1. Duration time,
  2. Offset position
)

Adds a position as the given time to the tracker.

Implementation

void addPosition(Duration time, Offset position) {
  _index += 1;
  if (_index == _historySize) {
    _index = 0;
  }
  _samples[_index] = _PointAtTime(position, time);
}