highlightNext method

ViewportModel highlightNext()

Moves the viewport to the next highlight.

Implementation

ViewportModel highlightNext() {
  if (_highlights.isEmpty) return this;
  final nextIndex = (currentHighlightIndex + 1) % _highlights.length;
  return copyWith(currentHighlightIndex: nextIndex)._showHighlight();
}