title: flutter - async function always returns null, while it is not null
body: <p>I am using Bloc architect for my project. I am trying to use a function from my Bloc file in the Ui of my app, and send a form to server and use the response. but when I make the call it returns null. while the response is not null in other parts of my app(i.e repo etc.) here is the code of my Ui:</p>
  
  <pre><code>MaterialButton(
                        color: Colors.deepPurple,
                        minWidth: screenAwareSize(500, context),
                        onPressed: () {
                          _submitForm(authBloc, user, pass);
                        },
   void _submitForm(AuthBloc authBloc, String user, String pass) async {
      formKey.currentState.save();
      if (formKey.currentState.validate()) {
        var response = await authBloc.login(user, pass);
  //when I print(response) it shows null
  
  
      }
    }
  </code></pre>
  
  <p>here is my bloc class:</p>
  
  <pre><code>class AuthBloc extends MainBloc {
    final Repo _repo = Repo();
    PublishSubject&lt;Future&lt;UserModel&gt;&gt; _authController = new PublishSubject&lt;Future&lt;UserModel&gt;&gt;();
    Observable&lt;Future&lt;UserModel&gt;&gt; get auth =&gt; _authController.stream;
    login(String user, String pass) async {
  
      Future&lt;UserModel&gt; item = await _repo.login(user, pass);
      _authController.sink.add(item);
    }
  
    dispose() {
      _authController.close();
    }
  }
  
  AuthBloc authBloc = new AuthBloc();
  </code></pre>
  
  <p>and here is my API class:</p>
  
  <pre><code>class API{
   Future&lt;UserModel&gt; login(String user, String pass) async {
      var response =
          await client.get(base_url + "login.php?user=${user}&amp;pass=${pass}");
      return UserModel.fromJSON(json.decode(response.body));
    }}
  </code></pre>
  
  <p>here is my repo class:</p>
  
  <pre><code> class Repo {
      final API api = new API();
    login(String user, String pass) async =&gt; await api.login(user, pass);}
  </code></pre>