Spec-Zone.ru › Dart 2

dart:html

метод insertAll

void insertAll(
  1. int index,
  2. Iterable<E> iterable
)
override

Вставляет все объекты из iterable в позицию index этого списка.

Это увеличивает длину списка на длину iterable и сдвигает все последующие объекты к концу списка.

Список должен быть расширяемым. Значение index должно быть неотрицательным и не превышать длину.

final numbers = <int>[1, 2, 3, 4];
final insertItems = [10, 11];
numbers.insertAll(2, insertItems);
print(numbers); // [1, 2, 10, 11, 3, 4]

Реализация

void insertAll(int index, Iterable<E> iterable) {
  throw new UnsupportedError("Cannot add to immutable List.");
}

© 2012 the Dart project authors
Licensed under the BSD 3-Clause "New" or "Revised" License.
https://api.dart.dev/stable/2.19.6/dart-html/ImmutableListMixin/insertAll.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API