title: How to parse this JSON Array in Flutter?
body: <p>I am working with Flutter and am currently trying to create a graph. I am looking to parse this JSON Array from the link below. My issue is that the information provided in the "prices" object, the values are all inside arrays themselves. I want to get those values and split them into an X and Y list but I have no idea how to accomplish this. I posted a snippet of the JSON data below.</p>
  
  <p><a href="https://api.coingecko.com/api/v3/coins/bitcoin/market_chartvs_currency=usd&amp;days=1" rel="nofollow noreferrer">https://api.coingecko.com/api/v3/coins/bitcoin/market_chartvs_currency=usd&amp;days=1</a></p>
  
  <p>I am only familiar with parsing data by creating a class and constructor. Then create a <code>fromJSON(Map&lt;String, dynamic&gt; json)</code> class and putting the data into a list, as shown in the code snippet below that I created from another URL with object values. How could I go about parsing this array JSON data into two list data?</p>
  
  <blockquote>
    <p>CODE TO PARSE JSON</p>
  </blockquote>
  
  <pre><code>List&lt;Coins&gt; _coins = List&lt;Coins&gt;();
  Future&lt;List&lt;Coins&gt;&gt; fetchCoins() async {
  var url = 'URL';
  var response = await http.get(url);
  
  var coins = List&lt;Coins&gt;();
  
  if (response.statusCode == 200) {
    var coinsJSON = json.decode(response.body);
    for (var coinJSON in coinsJSON) {
      coins.add(Coins.fromJson(coinJSON));
    }
  }
  return coins;
   }
  
  @override
  void initState() {
  fetchCoins().then((value) {
    setState(() {
      _coins.addAll(value);
    });
  });
  super.initState();
  }
  
  class Coins{
  String symbol;
  String name;
  
  Coins(this.symbol, this.name);
  
  Coins.fromJson(Map&lt;String, dynamic&gt; json) {
  symbol = json['symbol'];
  name = json['name'];
  </code></pre>
  
  <blockquote>
    <p>JSON DATA SNIPPET</p>
  </blockquote>
  
  <pre><code>{
  "prices":[
    [
       1566344769277,
       10758.856131083012
    ],
    [
       1566345110646,
       10747.91694691537
    ],
    [
       1566345345922,
       10743.789313302059
    ],
  ]
  }
  </code></pre>
  
  <blockquote>
    <p>EDIT: SOLVED WITH THE HELP OF @EJABU. </p>
  </blockquote>
  
  <pre><code>class HistoricalData {
   List prices;
   List&lt;num&gt; listX = [];
  List&lt;num&gt; listY = [];
  
  HistoricalData(this.prices,this.listX, this.listY);
  
  HistoricalData.fromJson(Map&lt;String, dynamic&gt; json) {
  prices = json['prices'];
  for (var price in prices) {
    listX.add(price[0]);
    listY.add(price[1]);
   }
  }
  </code></pre>