setRange abstract method Null safety
Writes some elements of
iterable into a range of this list.
Copies the objects of
skipCount objects first,
into the range from
start, inclusive, to
end, exclusive, of this list.
final list1 = <int>[1, 2, 3, 4]; final list2 = <int>[5, 6, 7, 8, 9]; // Copies the 4th and 5th items in list2 as the 2nd and 3rd items // of list1. const skipCount = 3; list1.setRange(1, 3, list2, skipCount); print(list1); // [1, 8, 9, 4]
The provided range, given by
end, must be valid.
A range from
end is valid if 0 ≤
end ≤ length.
An empty range (with
end == start) is valid.
iterable must have enough objects to fill the range from
end after skipping
iterable is this list, the operation correctly copies the elements
originally in the range from
skipCount + (end - start) to
end, even if the two ranges overlap.
iterable depends on this list in some other way, no guarantees are
void setRange(int start, int end, Iterable<E> iterable, [int skipCount = 0]);