title: Flutter call http requests from a unit\widget test without mocking
body: <p>I have an app that follows MVC+service architecture. The service layer makes the http requests for rest APIs. However the response of the http requests change intermittently which cause my models to change or else random crashes in my app. SO to capture the change in these APIs I want to write some automated tests which can tell me exactly what changed. A sample test case is as following:</p>
  
  <pre><code>test("login_valid", () async {
      final loginData = LoginData(
        email: "abc@gmail.com",
        password: "123"
      );
      final parameters = loginData.toJson();
  
      var json = await httpService.post(parameters);
      var loginResponse = LoginResponse.fromJson(json);
  
      expect(loginResponse.status, "OK");
    });
  </code></pre>
  
  <p><strong>However, the above code throws <code>SocketException</code> upon run. I know this exception is thrown when <code>INTERNET</code> permission is not given in <code>AndroidManifest.xml</code> but I don't know how to set this for unit\widget tests.</strong></p>
  
  <p>P.S. I can't mock the service layer using <code>mockit</code> or similar framework because the whole point is to test my service layer which doesn't have any business logic but just provides network integration.</p>
  
  <p>Any solution or suggestion will be really helpful. I am okay with other approaches to achieve the same intent also, if there are any.</p>