update method

void update(
  1. Position position
)

Implementation

void update(Position position) {
  final start = _start;
  if (start == null) {
    return;
  }

  if (position.isBefore(start) && !_endFixed) {
    _endFixed = true;
    _end = _start;
  }

  if (position.isAfter(start) && _endFixed) {
    _endFixed = false;
    _start = _end;
  }

  if (_endFixed) {
    _start = position;
  } else {
    _end = position;
  }

  // print('($_start, $end');
}