shorter nullable list duplications (#30305)
This commit is contained in:
parent
1ae32facfe
commit
32f1b810ae
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -1813,7 +1813,7 @@ class _MatchesSemanticsData extends Matcher {
|
||||
final List<CustomSemanticsAction> providedCustomActions = data.customSemanticsActionIds.map((int id) {
|
||||
return CustomSemanticsAction.getAction(id);
|
||||
}).toList();
|
||||
final List<CustomSemanticsAction> expectedCustomActions = List<CustomSemanticsAction>.from(customActions ?? const <int>[]);
|
||||
final List<CustomSemanticsAction> expectedCustomActions = customActions?.toList() ?? <CustomSemanticsAction>[];
|
||||
if (hintOverrides?.onTapHint != null)
|
||||
expectedCustomActions.add(CustomSemanticsAction.overridingAction(hint: hintOverrides.onTapHint, action: SemanticsAction.tap));
|
||||
if (hintOverrides?.onLongPressHint != null)
|
||||
|
Loading…
x
Reference in New Issue
Block a user