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.18.5/dart-html/ImmutableListMixin/insertAll.html

Spec-Zone.ru

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