title: Flutter: Await HTTP Request going in loop
body: <p>I am facing strange issue while doing http async request. I know the reason why it is failing but don't know how to fix it.
  Here is my code.</p>
  
  <pre><code>    Future userLogin() async{
   try{
      String email = emailController.text;
      String password = passwordController.text;
      var url = 'http://192.168.100.4:8080/myapp/loginnexec.php';
  
        // Store all data with Param Name.
        var data = {'email': email, 'password' : password };
       print(data);
        // Starting Web API Call.
        var response = await http.post(url, body: json.encode(data));
  
        // Getting Server response into variable.
  
        final message = loginFromJson(response.body);
      if(response.statusCode == 200){
          setState(() {
            visible = false;
          });
  
        }
  
      }
       }catch(e){
       .....
       }
      }
  </code></pre>
  
  <p>If my web server is down or file is not available then it is going to an infinite loop. I mean all the time i am able to see the same JSON data which is this (var data = {'email': email, 'password' : password }.</p>
  
  <p>I want to know how can I prevent it from going in a loop. It looks like it is trying to reach to webserver for data and if it is not getting the data then trying again.</p>
  
  <p>I am not sure I have explained it properly or not. </p>
  
  <p>Sorry about my bad English. </p>