Commit 32f1b810 authored by Alexandre Ardhuin's avatar Alexandre Ardhuin Committed by Dan Field

shorter nullable list duplications (#30305)

parent 1ae32fac
...@@ -119,7 +119,7 @@ class ListModel<E> { ...@@ -119,7 +119,7 @@ class ListModel<E> {
Iterable<E> initialItems, Iterable<E> initialItems,
}) : assert(listKey != null), }) : assert(listKey != null),
assert(removedItemBuilder != null), assert(removedItemBuilder != null),
_items = List<E>.from(initialItems ?? <E>[]); _items = initialItems?.toList() ?? <E>[];
final GlobalKey<AnimatedListState> listKey; final GlobalKey<AnimatedListState> listKey;
final dynamic removedItemBuilder; final dynamic removedItemBuilder;
......
...@@ -613,7 +613,7 @@ class _ListModel { ...@@ -613,7 +613,7 @@ class _ListModel {
Iterable<int> initialItems, Iterable<int> initialItems,
}) : assert(listKey != null), }) : assert(listKey != null),
assert(removedItemBuilder != null), assert(removedItemBuilder != null),
_items = List<int>.from(initialItems ?? <int>[]); _items = initialItems?.toList() ?? <int>[];
final GlobalKey<AnimatedListState> listKey; final GlobalKey<AnimatedListState> listKey;
final dynamic removedItemBuilder; final dynamic removedItemBuilder;
......
...@@ -1813,7 +1813,7 @@ class _MatchesSemanticsData extends Matcher { ...@@ -1813,7 +1813,7 @@ class _MatchesSemanticsData extends Matcher {
final List<CustomSemanticsAction> providedCustomActions = data.customSemanticsActionIds.map((int id) { final List<CustomSemanticsAction> providedCustomActions = data.customSemanticsActionIds.map((int id) {
return CustomSemanticsAction.getAction(id); return CustomSemanticsAction.getAction(id);
}).toList(); }).toList();
final List<CustomSemanticsAction> expectedCustomActions = List<CustomSemanticsAction>.from(customActions ?? const <int>[]); final List<CustomSemanticsAction> expectedCustomActions = customActions?.toList() ?? <CustomSemanticsAction>[];
if (hintOverrides?.onTapHint != null) if (hintOverrides?.onTapHint != null)
expectedCustomActions.add(CustomSemanticsAction.overridingAction(hint: hintOverrides.onTapHint, action: SemanticsAction.tap)); expectedCustomActions.add(CustomSemanticsAction.overridingAction(hint: hintOverrides.onTapHint, action: SemanticsAction.tap));
if (hintOverrides?.onLongPressHint != null) if (hintOverrides?.onLongPressHint != null)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment