title: Flutter JSON String/Int commands
body: <p>I'm trying to make an app that retrieves <strong>data</strong> from <a href="https://api.coinmarketcap.com/v2/ticker/" rel="nofollow noreferrer"><strong>this JSON list</strong></a> and <strong>parse</strong> this data to a <code>listview</code>. </p>
  
  <p>With my <strong>code</strong> below, the first record I expect to see is <code>ID</code>, <code>NAME</code> and <code>PRICE</code>, but it appears that I can't retrieve the <code>PRICE</code>, because it's an <code>int</code> and I'm calling for a <code>string</code> from the <strong>JSON</strong> list. </p>
  
  <p>Also, 'PRICE' is an int just like 'ID', as sam mentioned below, but 'ID' is fetched just fine whereas 'PRICE' just says 'NULL' in the list view</p>
  
  <p>I don't know how to fix this, and hope I can get the answer I'm looking for on this platform. </p>
  
  <p>FirstPage.dart :</p>
  
  <pre><code>import 'package:flutter/material.dart';
  import 'dart:async';
  import 'dart:convert';
  import 'package:http/http.dart' as http;
  
  void main() {
    runApp(MaterialApp(
      home: StarWarsData(),
    ));
  }
  
  class StarWarsData extends StatefulWidget {
    @override
    StarWarsState createState() =&gt; StarWarsState();
  }
  
  class StarWarsState extends State&lt;StarWarsData&gt; {
    final String url = "https://api.coinmarketcap.com/v2/ticker/";
    List data;
  
    Future&lt;String&gt; getSWData() async {
      var res = await http
          .get(Uri.encodeFull(url), headers: {"Accept": "application/json"});
  
      setState(() {
        var resBody = json.decode(res.body);
        data = resBody["data"];
      });
  
      return "Success!";
    }
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        appBar: AppBar(
          title: Text("Cryp-Tick Crypto Exchange"),
          centerTitle: true,
          backgroundColor: Colors.black,
        ),
        body: ListView.builder(
          itemCount: data == null ? 0 : data.length,
          itemBuilder: (BuildContext context, int index) {
            return new Container(
              child: Center(
                child: Column(
                  crossAxisAlignment: CrossAxisAlignment.stretch,
                  children: &lt;Widget&gt;[
                    Card(
                      child: Container(
                          padding: EdgeInsets.all(15.0),
                          child: Row(
                            children: &lt;Widget&gt;[
                              Text("Id: "),
                              Text('${data[index]["id"]}',
                                  style: TextStyle(
                                      fontSize: 18.0, color: Colors.black87)),
                            ],
                          )),
                    ),
                    Card(
                      child: Container(
                          padding: EdgeInsets.all(15.0),
                          child: Row(
                            children: &lt;Widget&gt;[
                              Text("Name: "),
                              Text('${data[index]["name"]}',
                                  style: TextStyle(
                                      fontSize: 18.0, color: Colors.red)),
                            ],
                          )),
                    ),
                    Card(
                      child: Container(
                          padding: EdgeInsets.all(15.0),
                          child: Row(
                            children: &lt;Widget&gt;[
                              Text("Price: "),
                              Text('${data[index]["price"]}',
                                  style: TextStyle(
                                      fontSize: 18.0, color: Colors.black87)),
                            ],
                          )),
                    ),
                  ],
                ),
              ),
            );
          },
        ),
      );
    }
  
    @override
    void initState() {
      super.initState();
      this.getSWData();
    }
  }
  </code></pre>
  
  <p>The error I receive in the <strong>Debug Console</strong>:</p>
  
  <pre><code>E/flutter (25480): [ERROR:topaz/lib/tonic/logging/dart_error.cc(16)] Unhandled exception:
  E/flutter (25480): type '_InternalLinkedHashMap&lt;String, dynamic&gt;' is not a subtype of type 'List' where
  E/flutter (25480):   _InternalLinkedHashMap is from dart:collection
  E/flutter (25480):   String is from dart:core
  E/flutter (25480):   List is from dart:core
  </code></pre>