Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(759)

Unified Diff: samples/swarm/swarm_ui_lib/observable/observable.dart

Issue 12383073: Add List.insert. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Use insertBefore and add is-check. Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/lib/growable_array.dart ('k') | sdk/lib/_collection_dev/list.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/swarm/swarm_ui_lib/observable/observable.dart
diff --git a/samples/swarm/swarm_ui_lib/observable/observable.dart b/samples/swarm/swarm_ui_lib/observable/observable.dart
index e60b8a92ee23585f7eca59833ebcd1a5cb3f3c35..db02b3e8ee86cadf6f17c2f355e35eb234d42fe4 100644
--- a/samples/swarm/swarm_ui_lib/observable/observable.dart
+++ b/samples/swarm/swarm_ui_lib/observable/observable.dart
@@ -198,6 +198,11 @@ class ObservableList<T>
T min([int compare(T a, T b)]) => _internal.min(compare);
T max([int compare(T a, T b)]) => _internal.max(compare);
+ void insert(int index, T element) {
+ _internal.insert(index, element);
+ recordListInsert(index, element);
+ }
+
T removeLast() {
final result = _internal.removeLast();
recordListRemove(length, result);
« no previous file with comments | « runtime/lib/growable_array.dart ('k') | sdk/lib/_collection_dev/list.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698