title: Get object data from future flutter
body: <p>I have to check the email and password with the rest API that is going well. The problem is my future is returning a class object that has a token. I need that that for other screen and after login navigate to other screens.</p>
  <pre><code>   Future&lt;LoginResponse&gt; createLoginState(String email, String password) async {
    final http.Response response = await http.post(
        'https://www.polestarkw.com/api/login',
        headers: &lt;String, String&gt;{
          'Accept': 'application/json',
          //'content-type' : 'application/json'
        },
        body: {
        &quot;email&quot;:email ,
        &quot;password&quot;:password ,
        });
  
    if (response.statusCode == 200) {
     // print(response.body);
      LoginResponse loginResponse=LoginResponse.fromJson(json.decode(response.body)) ;
      return loginResponse;
    } else {
      throw Exception('Failed to create album.');
    }
  }
  
  class LoginResponse {
    Object _data;
    String token_type;
    String expires_in;
    String access_token;
    String refresh_token;
  
    LoginResponse(
        {this.token_type, this.expires_in, this.access_token, this.refresh_token});
  
    LoginResponse.fromJson(Map&lt;String, dynamic&gt; json) {
      token_type = json['token_type'];
      expires_in = json['expires_in'];
      access_token = json['access_token'];
      refresh_token = json['refresh_token'];
    }
  
  
  }
  </code></pre>
  <p>I need this loginResponse object on my other page. Here is using a future instance.</p>
  <pre><code> _futureJwt = createLoginState(emailController.text, pwdController.text);
  </code></pre>
  <p>how to get data from _futureJwt.</p>