Index: pkg/observe/lib/src/list_path_observer.dart |
diff --git a/pkg/observe/lib/src/list_path_observer.dart b/pkg/observe/lib/src/list_path_observer.dart |
index e67f9d3f87e1c99e1c05f8326b10a569ba0bbe90..5c7f1be21b26d0553682f5a301b1d78501e8266d 100644 |
--- a/pkg/observe/lib/src/list_path_observer.dart |
+++ b/pkg/observe/lib/src/list_path_observer.dart |
@@ -26,11 +26,10 @@ class ListPathObserver<E, P> extends ChangeNotifier { |
ListPathObserver(this.list, String path) |
: _itemPath = path { |
- _sub = list.changes.listen((records) { |
+ // TODO(jmesserly): delay observation until we are observed. |
+ _sub = list.listChanges.listen((records) { |
for (var record in records) { |
- if (record is ListChangeRecord) { |
- _observeItems(record.addedCount - record.removedCount); |
- } |
+ _observeItems(record.addedCount - record.removed.length); |
} |
_scheduleReduce(null); |
}); |