title: Error listing information from an API (Expected a value of type 'int', but got one of type 'String')
body: <p>I'm getting information from a REST API, but when displaying the information I get the error:</p>
  <blockquote>
  <p>Error: Exception: Expected a value of type 'int', but got one of type 'String'</p>
  </blockquote>
  <p>This is my get method:</p>
  <pre><code>  Future&lt;List&lt;Requests&gt;&gt; searchRequests() async {
      try {
        final response = await http.get(
            Uri.parse(BaseUrl.baseUrl + 'api/search'));
        if (response.statusCode == 200) {
          List&lt;Requests&gt; list = parseRequests(response.body);
          return list;
        } else {
          throw Exception(&quot;Error&quot;);
        }
      } catch (e) {
        throw Exception(e.toString());
      }
    }
  
    static List&lt;Requests&gt; parseRequests(String responseBody) {
      final parsed = json.decode(responseBody).cast&lt;Map&lt;String, dynamic&gt;&gt;();
      return parsed
          .map&lt;Requests&gt;((json) =&gt; Requests.fromJson(json))
          .toList();
    }
  </code></pre>
  <p>and defined my model like this:</p>
  <pre><code>import 'package:flutter_gentelella/models/usuario.dart';
  
  class Requests {
    final String id;
    final String data1;
    final String data2;
    final int data3;
  
    const Requests({
      required this.id,
      required this.data1,
      required this.data2,
      required this.data3,
    });
  
    factory Requests.fromJson(Map&lt;String, dynamic&gt; json) {
      return Solicitacoes(
          id: json['_id'],
          data1: json['data1'],
          data2: json['data2'],
          data3: json['user']['data3']);
    }
  
    Map&lt;String, dynamic&gt; toJson() =&gt; {
          '_id': id,
          'data1': data1,
          'data2': data2,
          'data3': data3,
        };
  }
  
  </code></pre>
  <p><strong>At what point in the code do I convert to int?</strong></p>
  <p>I'm trying to generate the order list on the screen but I get the error reported above. I appreciate if someone helps me analyze!</p>