title: How to make a http request in a flutter widget test?
body: <p>I'm trying to make an HTTP request from within a flutter widget test, but for some reason, the widget test always times out after 5 sec, whereas it works perfectly fine in a unit test.</p>
  
  <pre><code>import 'package:flutter_test/flutter_test.dart';
  import 'dart:io';
  import 'dart:convert';
  
  void main() {
    test('http unit-test works', () async {
      var httpClient = new HttpClient();
      var request = await httpClient.getUrl(Uri.parse('https://api.ipify.org/'));
      var response = await request.close();
      var responseBody = await response.transform(UTF8.decoder).join();
      print('BODY: $responseBody');
    });
  
    testWidgets('http widget-test does not work', (WidgetTester tester) async {
      var httpClient = new HttpClient();
      var request = await httpClient.getUrl(Uri.parse('https://api.ipify.org/'));
      var response = await request.close();
      var responseBody = await response.transform(UTF8.decoder).join();
      print('BODY: $responseBody');
    });
  }
  </code></pre>
  
  <p>Is the flutter test environment eating my HTTP request here? How can I prevent it from doing this?</p>