метод removeAt
- int index
переопределённый
Удаляет объект из позиции index в этом списке.
Этот метод уменьшает длину this на единицу и сдвигает все последующие объекты на одну позицию вниз.
Возвращает удалённое значение.
index должно находиться в диапазоне 0 ≤ index < length. Список должен быть изменяемым по размеру.
final parts = <String>['head', 'shoulder', 'knees', 'toes']; final retVal = parts.removeAt(2); // knees print(parts); // [head, shoulder, toes]
Реализация
E removeAt(int index) {
E result = this[index];
_closeGap(index, index + 1);
return result;
}
© 2012 the Dart project authors
Licensed under the BSD 3-Clause "New" or "Revised" License.
https://api.dart.dev/stable/2.19.6/dart-collection/ListMixin/removeAt.html