diff --git a/packages/flutter/lib/src/widgets/nested_scroll_view.dart b/packages/flutter/lib/src/widgets/nested_scroll_view.dart index b1adb2948378..bd4ef1acc5e6 100644 --- a/packages/flutter/lib/src/widgets/nested_scroll_view.dart +++ b/packages/flutter/lib/src/widgets/nested_scroll_view.dart @@ -1209,8 +1209,7 @@ class _NestedScrollController extends ScrollController { } Iterable<_NestedScrollPosition> get nestedPositions { - // TODO(vegorov): use instance method version of castFrom when it is available. - return Iterable.castFrom(positions); + return positions.cast<_NestedScrollPosition>(); } } diff --git a/packages/flutter_driver/lib/src/driver/timeline.dart b/packages/flutter_driver/lib/src/driver/timeline.dart index 16d2a62cf72b..482cad804bc8 100644 --- a/packages/flutter_driver/lib/src/driver/timeline.dart +++ b/packages/flutter_driver/lib/src/driver/timeline.dart @@ -111,11 +111,11 @@ List? _parseEvents(Map json) { return null; } - final List timelineEvents = - Iterable.castFrom>(jsonEvents) - .map( - (Map eventJson) => TimelineEvent(eventJson)) - .toList(); + final List timelineEvents = jsonEvents + .cast>() + .map( + (Map eventJson) => TimelineEvent(eventJson)) + .toList(); timelineEvents.sort((TimelineEvent e1, TimelineEvent e2) { return switch ((e1.timestampMicros, e2.timestampMicros)) {