mirror of
https://github.com/flutter/flutter
synced 2024-10-13 11:42:54 +00:00
parent
26ed1e71f9
commit
b7fd5426b5
|
@ -118,8 +118,10 @@ class WidgetTester {
|
|||
Element element = finder.findFirst(this);
|
||||
Widget widget = element.widget;
|
||||
|
||||
if (widget is StatefulWidget)
|
||||
return (element as StatefulElement).state;
|
||||
if (widget is StatefulWidget) {
|
||||
StatefulElement statefulElement = element;
|
||||
return statefulElement.state;
|
||||
}
|
||||
|
||||
throw new ElementNotFoundError(
|
||||
'Widget of type ${widget.runtimeType} found by ${finder.description} does not correspond to a StatefulWidget'
|
||||
|
|
|
@ -29,7 +29,7 @@ linter:
|
|||
- always_declare_return_types
|
||||
- always_specify_types
|
||||
- annotate_overrides
|
||||
# - avoid_as # https://github.com/dart-lang/linter/issues/195
|
||||
- avoid_as
|
||||
- avoid_init_to_null
|
||||
# - avoid_return_types_on_setters # https://github.com/dart-lang/linter/issues/202
|
||||
- camel_case_types
|
||||
|
|
|
@ -143,7 +143,8 @@ class Cache {
|
|||
os.unzip(tempFile, location);
|
||||
tempFile.deleteSync();
|
||||
} else {
|
||||
(location as File).writeAsBytesSync(fileBytes, flush: true);
|
||||
File file = location;
|
||||
file.writeAsBytesSync(fileBytes, flush: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue