Silence new analyzer warnings (#6866)

See https://github.com/flutter/flutter/pull/6861

This silences all but two of the warnings from https://travis-ci.org/flutter/flutter/builds/176055550

One of the silenced warnings was a genuine code error.

Some of the others were correct but there was no way for the analyzer to know, and I worked around them.

The remainder are problems with the analyzer, specifically https://github.com/dart-lang/sdk/issues/27827 and https://github.com/dart-lang/sdk/issues/27504.
This commit is contained in:
Ian Hickson
2016-11-15 12:35:50 -08:00
committed by GitHub
parent 9f1c91f934
commit 2b84d1ff1b
11 changed files with 40 additions and 36 deletions

View File

@@ -342,7 +342,7 @@ abstract class TestWidgetsFlutterBinding extends BindingBase
stack: stack,
context: 'running a test',
library: 'Flutter test framework',
stackFilter: (List<String> frames) {
stackFilter: (Iterable<String> frames) {
return FlutterError.defaultStackFilter(frames.skip(stackLinesToOmit));
},
informationCollector: (StringBuffer information) {

View File

@@ -130,7 +130,7 @@ class WidgetController {
TestAsyncUtils.guardSync();
return allElements
.where((Element element) => element is StatefulElement)
.map((StatefulElement element) => element.state);
.map((StatefulElement element) => element.state); // ignore: INVALID_CAST_FUNCTION_EXPR, https://github.com/dart-lang/sdk/issues/27827
}
/// The matching state in the widget tree.