Allow dart_internal 0.2.0 & fix analyzer/formatter issues (#102)
* Format map_change_record.dart
* Replace direct List constructor with .filled
* Allow dart_internal 0.2.0
diff --git a/lib/src/differs/list_differ.dart b/lib/src/differs/list_differ.dart
index 712d065..6aa227c 100644
--- a/lib/src/differs/list_differ.dart
+++ b/lib/src/differs/list_differ.dart
@@ -59,11 +59,11 @@
// 'Deletion' columns.
final rowCount = oldEnd - oldStart + 1;
final columnCount = currentEnd - currentStart + 1;
- final distances = List<List<int>>(rowCount);
+ final distances = List<List<int>>.filled(rowCount, null);
// 'Addition' rows. Initialize null column.
for (var i = 0; i < rowCount; i++) {
- distances[i] = List<int>(columnCount);
+ distances[i] = List<int>.filled(columnCount, null);
distances[i][0] = i;
}
diff --git a/lib/src/observable_list.dart b/lib/src/observable_list.dart
index 863d0ad..424be3f 100644
--- a/lib/src/observable_list.dart
+++ b/lib/src/observable_list.dart
@@ -45,7 +45,7 @@
/// If a [length] argument is supplied, a fixed size list of that
/// length is created.
ObservableList([int length])
- : _list = length != null ? List<E>(length) : <E>[];
+ : _list = length != null ? List<E>.filled(length, null) : <E>[];
/// Creates an observable list of the given [length].
///
diff --git a/lib/src/records/map_change_record.dart b/lib/src/records/map_change_record.dart
index dc252d2..8c6b184 100644
--- a/lib/src/records/map_change_record.dart
+++ b/lib/src/records/map_change_record.dart
@@ -76,7 +76,11 @@
@override
String toString() {
- final kind = isInsert ? 'insert' : isRemove ? 'remove' : 'set';
+ final kind = isInsert
+ ? 'insert'
+ : isRemove
+ ? 'remove'
+ : 'set';
return '#<MapChangeRecord $kind $key from $oldValue to $newValue>';
}
}
diff --git a/pubspec.yaml b/pubspec.yaml
index 153fdab..8de42fd 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -8,7 +8,7 @@
dependencies:
collection: ^1.11.0
- dart_internal: ^0.1.1
+ dart_internal: ">=0.1.1 < 0.3.0"
meta: ^1.0.4
quiver: '>=0.24.0 <3.0.0'