slice<T> function
Implementation
List<T> slice<T>(List<T> list, int begin, [int? end]) => list
.getRange(
begin,
end == null
? list.length
: end < 0
? list.length + end
: end)
.toList();