diff --git a/dev/devicelab/bin/tasks/technical_debt__cost.dart b/dev/devicelab/bin/tasks/technical_debt__cost.dart index 4a7f822cb71..707d55cd7bb 100644 --- a/dev/devicelab/bin/tasks/technical_debt__cost.dart +++ b/dev/devicelab/bin/tasks/technical_debt__cost.dart @@ -15,9 +15,11 @@ const double todoCost = 1009.0; // about two average SWE days, in dollars const double ignoreCost = 2003.0; // four average SWE days, in dollars const double pythonCost = 3001.0; // six average SWE days, in dollars const double skipCost = 2473.0; // 20 hours: 5 to fix the issue we're ignoring, 15 to fix the bugs we missed because the test was off +const double asDynamicCost = 2003.0; // same as ignoring analyzer warning final RegExp todoPattern = new RegExp(r'(?://|#) *TODO'); final RegExp ignorePattern = new RegExp(r'// *ignore:'); +final RegExp asDynamicPattern = new RegExp(r'as dynamic'); Future findCostsForFile(File file) async { if (path.extension(file.path) == '.py') @@ -33,6 +35,8 @@ Future findCostsForFile(File file) async { total += todoCost; if (line.contains(ignorePattern)) total += ignoreCost; + if (line.contains(asDynamicPattern)) + total += asDynamicCost; if (isTest && line.contains('skip:')) total += skipCost; } diff --git a/examples/flutter_gallery/lib/demo/material/expansion_panels_demo.dart b/examples/flutter_gallery/lib/demo/material/expansion_panels_demo.dart index 4011ff977cf..ade4beb84c9 100644 --- a/examples/flutter_gallery/lib/demo/material/expansion_panels_demo.dart +++ b/examples/flutter_gallery/lib/demo/material/expansion_panels_demo.dart @@ -168,6 +168,8 @@ class DemoItem { ); }; } + + Widget build() => builder(this); } class ExpasionPanelsDemo extends StatefulWidget { @@ -351,7 +353,7 @@ class _ExpansionPanelsDemoState extends State { return new ExpansionPanel( isExpanded: item.isExpanded, headerBuilder: item.headerBuilder, - body: item.builder(item) + body: item.build() ); }).toList() ), diff --git a/packages/flutter/lib/src/widgets/nested_scroll_view.dart b/packages/flutter/lib/src/widgets/nested_scroll_view.dart index da04ca695a0..a82d596ce96 100644 --- a/packages/flutter/lib/src/widgets/nested_scroll_view.dart +++ b/packages/flutter/lib/src/widgets/nested_scroll_view.dart @@ -867,7 +867,8 @@ class _NestedScrollController extends ScrollController { } Iterable<_NestedScrollPosition> get nestedPositions sync* { - yield* positions; + // TODO(vegorov) use instance method version of castFrom when it is available. + yield* Iterable.castFrom(positions); } } diff --git a/packages/flutter/lib/src/widgets/overscroll_indicator.dart b/packages/flutter/lib/src/widgets/overscroll_indicator.dart index a8ff7dfb720..0a102a9bfb3 100644 --- a/packages/flutter/lib/src/widgets/overscroll_indicator.dart +++ b/packages/flutter/lib/src/widgets/overscroll_indicator.dart @@ -198,7 +198,7 @@ class _GlowingOverscrollIndicatorState extends State } } } else if (notification is ScrollEndNotification || notification is ScrollUpdateNotification) { - if (notification.dragDetails != null) { // ignore: undefined_getter + if ((notification as dynamic).dragDetails != null) { _leadingController.scrollEnd(); _trailingController.scrollEnd(); } diff --git a/packages/flutter_test/lib/src/binding.dart b/packages/flutter_test/lib/src/binding.dart index 7244ae6ec28..2e0fb9d050f 100644 --- a/packages/flutter_test/lib/src/binding.dart +++ b/packages/flutter_test/lib/src/binding.dart @@ -463,7 +463,7 @@ abstract class TestWidgetsFlutterBinding extends BindingBase )); assert(_parentZone != null); assert(_pendingExceptionDetails != null, 'A test overrode FlutterError.onError but either failed to return it to its original state, or had unexpected additional errors that it could not handle. Typically, this is caused by using expect() before restoring FlutterError.onError.'); - _parentZone.run(_testCompletionHandler); + _parentZone.run(_testCompletionHandler); } ); _parentZone = Zone.current; diff --git a/packages/flutter_test/lib/src/controller.dart b/packages/flutter_test/lib/src/controller.dart index 42ddce4f1f6..b60597727aa 100644 --- a/packages/flutter_test/lib/src/controller.dart +++ b/packages/flutter_test/lib/src/controller.dart @@ -132,8 +132,12 @@ class WidgetController { Iterable get allStates { TestAsyncUtils.guardSync(); return allElements + // TODO(vegorov) replace with Iterable.whereType, when it is available. https://github.com/dart-lang/sdk/issues/27827 .where((Element element) => element is StatefulElement) - .map((StatefulElement element) => element.state); // ignore: STRONG_MODE_INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27827 + .map((Element element) { + final StatefulElement statefulElement = element; + return statefulElement.state; + }); } /// The matching state in the widget tree. diff --git a/packages/flutter_tools/lib/src/test/flutter_platform.dart b/packages/flutter_tools/lib/src/test/flutter_platform.dart index e067c775ed4..2dc34909c77 100644 --- a/packages/flutter_tools/lib/src/test/flutter_platform.dart +++ b/packages/flutter_tools/lib/src/test/flutter_platform.dart @@ -479,7 +479,10 @@ void main() { return test.main; }); WebSocket.connect(server).then((WebSocket socket) { - socket.map(JSON.decode).pipe(channel.sink); + socket.map((dynamic x) { + assert(x is String); + return JSON.decode(x); + }).pipe(channel.sink); socket.addStream(channel.stream.map(JSON.encode)); }); }