title: How to make widget testing while using http.post
body: <p>I'm trying to use widget test for my project and test works fine till reach the point I use an http request in the actual page and it ,I think, ignore the request</p>
  <pre><code>final account = await http.post(
                    'http://10.0.2.2:5000/LogIn',
                    headers: &lt;String, String&gt;{
                      'Content-Type': 'application/json; charset=UTF-8',
                    },
                    body: json.encode({'email': email, 'password': password}),
                  );
  </code></pre>
  <p>the account.body returns empty while it works well during using the emulator</p>
  <pre><code> testWidgets(&quot;Successful Sign In&quot;, (WidgetTester tester) async {
    await tester.pumpWidget(MaterialApp(home: SignIn()));
  
    //1-find widgets needed
    final textfieldemail = find.byKey(Key(&quot;emailtextformfield&quot;));
    expect(textfieldemail, findsOneWidget);
    final textfieldpassword = find.byKey(Key(&quot;passwordtextformfield&quot;));
    expect(textfieldpassword, findsOneWidget);
    final buttonsignin = find.byKey(Key(&quot;Signin&quot;));
    expect(buttonsignin, findsOneWidget);
  
    //2-execute the actual test
    await tester.enterText(textfieldemail, &quot;Weaam.wewe91@gmail.com&quot;);
    await tester.enterText(textfieldpassword, &quot;Weaam@91&quot;);
    await tester.tap(buttonsignin);
    await tester.pump(Duration(seconds: 5));
    //await tester.pump(Duration(seconds: 5));
    //await _navigateToAccountHome(tester);
  
    //3-check results
    expect(find.byType(DeliveryHome), findsOneWidget);
  });
  </code></pre>
  <p>});</p>
  <p>I am not sure if I missed something I'm still beginner</p>