title: how to get data object in flutter
body: <p>hello i have json data like this</p>
  <pre><code>{
      &quot;iduser&quot;: 3,
      &quot;fname&quot;: &quot;joni&quot;
  }
  </code></pre>
  <p>I want to display it on the home page</p>
  <p>Previously I have created a model class below</p>
  <p>usermodel.dart</p>
  <pre><code>class UserModel {
    int id;
    String fname;
  
    UserModel(
      this.id,
      this.fname,
    );
  
    UserModel.fromJson(Map&lt;String, dynamic&gt; response) {
      id = response['iduser'];
      fname = response['fname'];
    }
  
    Map&lt;String, dynamic&gt; toJson() {
      return {
        'id': id,
        'fname': fname,
      };
    }
  }
  </code></pre>
  <p>and I created a service page to interact with api</p>
  <pre><code>class AuthService {
    String baseUrl = 'https://myurl.com';
    Future&lt;UserModel&gt; getUser() async {
      SharedPreferences prefs = await SharedPreferences.getInstance();
      var id = prefs.getInt('id');
      var token = prefs.getString('token');
      var url = '$baseUrl/users/$id';
      var headers = {
        'Content-Type': 'application/json',
        'Authorization': 'Bearer $token'
      };
  
      var response = await http.get(
        Uri.parse(url),
        headers: headers,
      );
  
      print(response.body);
  
      if (response.statusCode == 200) {
        var data = jsonDecode(response.body);
        UserModel user = UserModel.fromJson(data);
        return user;
      } else {
        print(response.body);
        throw Exception('Failed');
      }
    }
  }
  </code></pre>
  <p>home.dart</p>
  <pre><code>class HomePage extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return Container(
        color: Colors.white,
        child: Center(
          child: Text( ), //get json fname
        ),
      );
    }
  }
  </code></pre>
  <p>before I run but I get error type</p>
  <pre><code>'_InternalLinkedHashMap&lt;String, dynamic&gt;' is not a subtype of type 'FutureOr&lt;List&lt;GetUserModel&gt;&gt;'
  </code></pre>
  <p>how to display the fname I get from the service on the home page?
  thank you !</p>