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

Side by Side Diff: pkg/observe/lib/src/observable_list.dart

Issue 27618002: package:observe fix various api issues (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/observe/lib/src/observable_box.dart ('k') | pkg/observe/lib/src/observable_map.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of observe; 5 part of observe;
6 6
7 /** 7 /**
8 * Represents an observable list of model values. If any items are added, 8 * Represents an observable list of model values. If any items are added,
9 * removed, or replaced, then observers that are listening to [changes] 9 * removed, or replaced, then observers that are listening to [changes]
10 * will be notified. 10 * will be notified.
11 */ 11 */
12 class ObservableList<E> extends ListBase<E> with ChangeNotifierMixin { 12 class ObservableList<E> extends ListBase<E> with ChangeNotifier {
13 List<ListChangeRecord> _listRecords; 13 List<ListChangeRecord> _listRecords;
14 14
15 /** The inner [List<E>] with the actual storage. */ 15 /** The inner [List<E>] with the actual storage. */
16 final List<E> _list; 16 final List<E> _list;
17 17
18 /** 18 /**
19 * Creates an observable list of the given [length]. 19 * Creates an observable list of the given [length].
20 * 20 *
21 * If no [length] argument is supplied an extendable list of 21 * If no [length] argument is supplied an extendable list of
22 * length 0 is created. 22 * length 0 is created.
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 271
272 if (added > 0 || removed > 0) { 272 if (added > 0 || removed > 0) {
273 notifyChange(new ListChangeRecord(startIndex, addedCount: added, 273 notifyChange(new ListChangeRecord(startIndex, addedCount: added,
274 removedCount: removed)); 274 removedCount: removed));
275 } 275 }
276 276
277 offset += removed - added; 277 offset += removed - added;
278 } 278 }
279 } 279 }
280 } 280 }
OLDNEW
« no previous file with comments | « pkg/observe/lib/src/observable_box.dart ('k') | pkg/observe/lib/src/observable_map.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698