Commit b7fd5426 authored by Adam Barth's avatar Adam Barth

Enable avoid_as lint (#3612)

Related to #3608
parent 26ed1e71
...@@ -118,8 +118,10 @@ class WidgetTester { ...@@ -118,8 +118,10 @@ class WidgetTester {
Element element = finder.findFirst(this); Element element = finder.findFirst(this);
Widget widget = element.widget; Widget widget = element.widget;
if (widget is StatefulWidget) if (widget is StatefulWidget) {
return (element as StatefulElement).state; StatefulElement statefulElement = element;
return statefulElement.state;
}
throw new ElementNotFoundError( throw new ElementNotFoundError(
'Widget of type ${widget.runtimeType} found by ${finder.description} does not correspond to a StatefulWidget' 'Widget of type ${widget.runtimeType} found by ${finder.description} does not correspond to a StatefulWidget'
......
...@@ -29,7 +29,7 @@ linter: ...@@ -29,7 +29,7 @@ linter:
- always_declare_return_types - always_declare_return_types
- always_specify_types - always_specify_types
- annotate_overrides - annotate_overrides
# - avoid_as # https://github.com/dart-lang/linter/issues/195 - avoid_as
- avoid_init_to_null - avoid_init_to_null
# - avoid_return_types_on_setters # https://github.com/dart-lang/linter/issues/202 # - avoid_return_types_on_setters # https://github.com/dart-lang/linter/issues/202
- camel_case_types - camel_case_types
......
...@@ -143,7 +143,8 @@ class Cache { ...@@ -143,7 +143,8 @@ class Cache {
os.unzip(tempFile, location); os.unzip(tempFile, location);
tempFile.deleteSync(); tempFile.deleteSync();
} else { } else {
(location as File).writeAsBytesSync(fileBytes, flush: true); File file = location;
file.writeAsBytesSync(fileBytes, flush: true);
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment