title: Deserialize json array in Dart/Flutter
body: <p>How to deserialize this json array <code>[{"i":737,"n":1}]</code> to get the variable "i" e "n".</p>
  
  <p>Class to deserialize</p>
  
  <pre><code>    class PortasAbertas {
    int i;
    int n;
  
    PortasAbertas({this.i, this.n});
  
    PortasAbertas.fromJson(Map&lt;String, dynamic&gt; json) {
      i = json['i'];
      n = json['n'];
    }
  
    Map&lt;String, dynamic&gt; toJson() {
      return {
        'i': i,
        'n': n
      };
    }
  }
  </code></pre>
  
  <p>I'm trying deserialize the object using this code, but use it when dont have a array, but using array i don't know i can do it </p>
  
  <pre><code>   PortasAbertas objeto = new PortasAbertas.fromJson(responseJson);
       String _msg = ("Portas abertas: ${objeto.n}");
  </code></pre>