movePrevious method Null safety

bool movePrevious()

Move back to the previous element.

Returns true and updates current if successful.

Implementation

bool movePrevious() {
  assert(isValid);
  if (_currentLine <= 0) {
    return false;
  }
  final MapEntry<Offset, TextPosition> position = _getTextPositionForLine(_currentLine - 1);
  _currentLine -= 1;
  _currentOffset = position.key;
  _currentTextPosition = position.value;
  return true;
}