diff --git a/examples/catalog/lib/animated_list.dart b/examples/catalog/lib/animated_list.dart index e9c3084b67..11cbfdeb1a 100644 --- a/examples/catalog/lib/animated_list.dart +++ b/examples/catalog/lib/animated_list.dart @@ -119,7 +119,7 @@ class ListModel { Iterable initialItems, }) : assert(listKey != null), assert(removedItemBuilder != null), - _items = List.from(initialItems ?? []); + _items = initialItems?.toList() ?? []; final GlobalKey listKey; final dynamic removedItemBuilder; diff --git a/examples/flutter_gallery/lib/demo/shrine/expanding_bottom_sheet.dart b/examples/flutter_gallery/lib/demo/shrine/expanding_bottom_sheet.dart index 614c67687d..72047eb684 100644 --- a/examples/flutter_gallery/lib/demo/shrine/expanding_bottom_sheet.dart +++ b/examples/flutter_gallery/lib/demo/shrine/expanding_bottom_sheet.dart @@ -613,7 +613,7 @@ class _ListModel { Iterable initialItems, }) : assert(listKey != null), assert(removedItemBuilder != null), - _items = List.from(initialItems ?? []); + _items = initialItems?.toList() ?? []; final GlobalKey listKey; final dynamic removedItemBuilder; diff --git a/packages/flutter_test/lib/src/matchers.dart b/packages/flutter_test/lib/src/matchers.dart index 6a480e6448..816cdeced4 100644 --- a/packages/flutter_test/lib/src/matchers.dart +++ b/packages/flutter_test/lib/src/matchers.dart @@ -1813,7 +1813,7 @@ class _MatchesSemanticsData extends Matcher { final List providedCustomActions = data.customSemanticsActionIds.map((int id) { return CustomSemanticsAction.getAction(id); }).toList(); - final List expectedCustomActions = List.from(customActions ?? const []); + final List expectedCustomActions = customActions?.toList() ?? []; if (hintOverrides?.onTapHint != null) expectedCustomActions.add(CustomSemanticsAction.overridingAction(hint: hintOverrides.onTapHint, action: SemanticsAction.tap)); if (hintOverrides?.onLongPressHint != null)