retain method

  1. @override
void retain(
  1. int index,
  2. int? len,
  3. Style? style
)
override

Implementation

@override
void retain(int index, int? len, Style? style) {
  if (style == null) {
    return;
  }

  final local = math.min(length - index, len!);
  final remain = len - local;
  final node = _isolate(index, local);

  if (remain > 0 && node.next != null) {
    node.next?.retain(0, remain, style);
  }
  node.format(style);
}