@@ -112,7 +112,7 @@ abstract class TestWidgetsFlutterBinding extends BindingBase
|
||||
void initInstances() {
|
||||
timeDilation = 1.0; // just in case the developer has artificially changed it for development
|
||||
http.Client.clientOverride = () {
|
||||
return new http.MockClient((http.Request request){
|
||||
return new http.MockClient((http.BaseRequest request) {
|
||||
return new Future<http.Response>.value(
|
||||
new http.Response("Mocked: Unavailable.", 404, request: request)
|
||||
);
|
||||
|
||||
@@ -74,7 +74,11 @@ class WidgetController {
|
||||
/// * Use [firstWidget] if you expect to match several but only want the first.
|
||||
Iterable<Widget/*=T*/> widgetList/*<T extends Widget>*/(Finder finder) {
|
||||
TestAsyncUtils.guardSync();
|
||||
return finder.evaluate().map/*<T>*/((Element element) => element.widget);
|
||||
return finder.evaluate().map/*<T>*/((Element element) {
|
||||
// TODO(ianh): simplify once the VM can infer the return type
|
||||
dynamic/*=T*/ result = element.widget;
|
||||
return result;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -219,7 +223,11 @@ class WidgetController {
|
||||
/// * Use [firstRenderObject] if you expect to match several but only want the first.
|
||||
Iterable<RenderObject/*=T*/> renderObjectList/*<T extends RenderObject>*/(Finder finder) {
|
||||
TestAsyncUtils.guardSync();
|
||||
return finder.evaluate().map/*<T>*/((Element element) => element.renderObject);
|
||||
return finder.evaluate().map/*<T>*/((Element element) {
|
||||
// TODO(ianh): simplify once the VM can infer the return type
|
||||
dynamic/*=T*/ result = element.renderObject;
|
||||
return result;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user