castSlice function

List castSlice(
  1. List array, [
  2. int start = -1,
  3. int? end
])

Implementation

List castSlice(List array, [int start = -1, int? end]) {
  int length = array.length;
  end ??= length;
  return (start.isNegative && end >= length)
      ? array
      : baseSlice(array, start, end);
}