slice function

  1. @Deprecated("Use inbuilt List.sublist instead")
List slice(
  1. List list, {
  2. int start = 0,
  3. dynamic end,
})

Implementation

@Deprecated("Use inbuilt List.sublist instead")
List slice(List list, {int start = 0, dynamic end}) {
  end ??= list.length;
  if (end < 0) end = list.length + end;
  if (start < 0) start = list.length + start;
  return list.sublist(start, end);
}