getOffsetAfter method

int? getOffsetAfter(
  1. int offset
)

Returns the closest offset after offset at which the input cursor can be positioned.

Implementation

int? getOffsetAfter(int offset) {
  final int? nextCodeUnit = _text!.codeUnitAt(offset);
  if (nextCodeUnit == null) {
    return null;
  }
  return isHighSurrogate(nextCodeUnit) ? offset + 2 : offset + 1;
}