2012-04-01 8 views

답변

7

insertRange을 사용하면 새 요소를 추가 할 때 목록이 커집니다.

var list = ["1","3","4"]; 
list.insertRange(0, 1, "0"); 
list.insertRange(2, 1, "2"); 
list.forEach((e) => print(e)); 

당신은 ** 범위는 ** 속성이 나에게 이해가되지 않았다 다트 here

+0

'insertRange' 메소드가'insert()'와'insertAll()'으로 대체되었습니다. 참조 : http://api.dartlang.org/docs/releases/latest/dart_core/List.html – CedX

1

좋아, list.insertRange (index, range, [elem])가 내가 찾고있는 것처럼 솔기가납니다.

+0

에 그것을 밖으로 시도 할 수 있습니다. ** insertAtPosition() ** 및 ** replaceAtPosition() ** – Gero

+1

조쉬 블로흐 (Josh Bloch)는 지금 Dart 컬렉션 라이브러리를 개편하고 있으므로 insert()와 removeAt()가 곧 나옵니다 . – munificent

관련 문제