shorter nullable list duplications (#30305)

This commit is contained in:
Alexandre Ardhuin
2019-04-05 19:23:35 +02:00
committed by Dan Field
parent 1ae32facfe
commit 32f1b810ae
3 changed files with 3 additions and 3 deletions

View File

@@ -119,7 +119,7 @@ class ListModel<E> {
Iterable<E> initialItems,
}) : assert(listKey != null),
assert(removedItemBuilder != null),
_items = List<E>.from(initialItems ?? <E>[]);
_items = initialItems?.toList() ?? <E>[];
final GlobalKey<AnimatedListState> listKey;
final dynamic removedItemBuilder;

View File

@@ -613,7 +613,7 @@ class _ListModel {
Iterable<int> initialItems,
}) : assert(listKey != null),
assert(removedItemBuilder != null),
_items = List<int>.from(initialItems ?? <int>[]);
_items = initialItems?.toList() ?? <int>[];
final GlobalKey<AnimatedListState> listKey;
final dynamic removedItemBuilder;