slice method

Iterable<Node<Object?>>? slice({
  1. int? start,
  2. int? stop,
  3. int? step,
})

For a node whose value is an array, returns the slice of its children.

Implementation

Iterable<Node>? slice({int? start, int? stop, int? step}) {
  final v = value;
  if (v is List) {
    return sliceIndices(v.length, start, stop, step ?? 1)
        .map((index) => _element(v, index));
  }
  return null;
}