diff --git a/CHANGELOG.md b/CHANGELOG.md index 82be286..870ce11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.22.1+1 + +* Fixes for Dart2 runtime type errors. + ## 0.22.1 * Added `ObservableList.castFrom`, similar to `List.castFrom`. diff --git a/lib/src/observable_list.dart b/lib/src/observable_list.dart index b983e54..41eb260 100644 --- a/lib/src/observable_list.dart +++ b/lib/src/observable_list.dart @@ -303,7 +303,7 @@ class ObservableList extends ListBase with Observable { void _notifyListChange( int index, { - List removed: const [], + List removed, int addedCount: 0, }) { if (!hasListObservers) return; diff --git a/lib/src/records/list_change_record.dart b/lib/src/records/list_change_record.dart index 810843c..321a949 100644 --- a/lib/src/records/list_change_record.dart +++ b/lib/src/records/list_change_record.dart @@ -27,15 +27,16 @@ class ListChangeRecord implements ChangeRecord { factory ListChangeRecord( List object, int index, { - List removed: const [], + List removed, int addedCount: 0, }) { - return new ListChangeRecord._(object, index, removed, addedCount); + return new ListChangeRecord._( + object, index, removed ?? new UnmodifiableListView([]), addedCount); } /// Records an `add` operation at `object[index]` of [addedCount] elements. ListChangeRecord.add(this.object, this.index, this.addedCount) - : removed = const [] { + : removed = new UnmodifiableListView([]) { _assertValidState(); } diff --git a/pubspec.yaml b/pubspec.yaml index 97df0e0..cfbd37b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: observable -version: 0.22.1 +version: 0.22.1+1 author: Dart Team description: Support for marking objects as observable homepage: https://github.com/dart-lang/observable