title: Dart boolean stays the same after update
body: <p>I have a login page where the user credentials checks against a status response from a api. I've written a function that returns a future boolean from the check but my problem is that if the user puts the wrong info the first time all the times they try to log in after the function still comes back as false. </p>
  
  <p>I've print the user input to the console and it shows that the old info was updated but still comes back as false.
  Future boolean function:</p>
  
  <pre><code>bool loginCheck;
  Future&lt;bool&gt;check() async{
  try{
  await fetchResponse().then((response){
  if(response.status == "ok"){
  return loginCheck = true;
  }else {
    return loginCheck = false;
  }
  });
      }
      catch (e){
        print(e);
      }
      return loginCheck;
  } 
  </code></pre>
  
  <p>API response function:</p>
  
  <pre><code>Future &lt;SubsonicResponse&gt;fetchResponse() async{
    try{
  userClear();    
  loginUser();
  var authresponse = await http.get(authURL);
  if (authresponse.statusCode == 200){
  var jsondata = jsonDecode(authresponse.body);
  var data = apicallFromJson(jsondata);
  var response = data.subsonicResponse;
  return response;
  } else{
  }
  }
   catch (e){
      print(e);
      }
  }
  </code></pre>
  
  <p>other functions:</p>
  
  <pre><code>void loginUser() {
  serveraddress = _serveraddressController.text;
  password = _passwordController.text;
  username = _usernameController.text;
  print(username);
  print(password);
  print(serveraddress);
  }
  
  void loginclear(){
  _serveraddressController.clear();
  _passwordController.clear();
  _usernameController.clear();
  }
  
  void userClear(){
    loginCheck = null;
    serveraddress = null;
    password = null;
    username = null;
  }
  </code></pre>
  
  <p>as you can see above I've tried clearing the user input vars before the request and it updates to the newest user input but still comes back false
  Login button:</p>
  
  <pre><code>              onPressed: () {
                check().then((loginCheck){
                print(loginCheck);
                if(loginCheck == true){
                loginclear();
                return Get.toNamed('/home');
                } else {
                return showAlertDialog(context);
              }
            });
          },
  </code></pre>
  
  <p>If the user puts the right info in the first time it works no problem.</p>