title: type List<dynamic> is not a subtype of Map<String,dynamic>
body: <p>I have been able to follow a few tutorials on Flutter about basic UI design, and am new to API calls. I think I need to convert types after making the API call, but I have no idea how.</p>
  <p>Note: I know this is a lot of code in one file, but I will separate the API call file and custom class file from my main file</p>
  <pre><code>import 'dart:async';
  import 'dart:convert';
  import 'package:flutter/foundation.dart';
  import 'package:flutter/material.dart';
  import 'package:http/http.dart' as http;
  
  Future&lt;Country&gt; fetchAlbum() async {
    final response = await http.get('https://restcountries.eu/rest/v2/all');
  
    if (response.statusCode == 200) {
      // If the server did return a 200 OK response,
      // then parse the JSON.
      return Country.fromJson(json.decode(response.body));
    } else {
      // If the server did not return a 200 OK response,
      // then throw an exception.
      throw Exception('Failed to load album');
    }
  }
  
  class Country {
    final String name;
    final List&lt;String&gt; topLevelDomain;
    final String alpha2Code;
    final String alpha3Code;
    final String callingCodes;
    final String capital;
    final String region;
    final String subregion;
    final int population;
    final List&lt;int&gt; latlng;
    final String demonym;
    final int area;
    final int gini;
    final List&lt;String&gt; timezones;
    final List&lt;String&gt; borders;
    final String nativeName;
    final int numericCode;
    final List&lt;String&gt; currencies;
    final List&lt;String&gt; translations;
    final String flag;
    final String cioc;
  
    Country({
      @required this.name,
      @required this.topLevelDomain,
      @required this.alpha2Code,
      @required this.alpha3Code,
      @required this.callingCodes,
      @required this.capital,
      @required this.region,
      @required this.subregion,
      @required this.population,
      @required this.latlng,
      @required this.demonym,
      @required this.area,
      @required this.gini,
      @required this.timezones,
      @required this.borders,
      @required this.nativeName,
      @required this.numericCode,
      @required this.currencies,
      @required this.translations,
      @required this.flag,
      @required this.cioc,
    });
  
    factory Country.fromJson(Map&lt;String, dynamic&gt; json) {
      return Country(
        name: json['name'],
        topLevelDomain: json['topLevelDomain'],
        alpha2Code: json['alpha2Code'],
        alpha3Code: json['alpha3Code'],
        callingCodes: json['callingCodes'],
        capital: json['capital'],
        region: json['region'],
        subregion: json['subregion'],
        population: json['population'],
        latlng: json['latlng'],
        demonym: json['demonym'],
        area: json['area'],
        gini: json['gini'],
        timezones: json['timezones'],
        borders: json['borders'],
        nativeName: json['nativeName'],
        numericCode: json['numericCode'],
        currencies: json['currencies'],
        translations: json['translations'],
        flag: json['flag'],
        cioc: json['cioc'],
      );
    }
  }
  
  void main() =&gt; runApp(MyApp());
  
  class MyApp extends StatefulWidget {
    MyApp({Key key}) : super(key: key);
  
    @override
    _MyAppState createState() =&gt; _MyAppState();
  }
  
  class _MyAppState extends State&lt;MyApp&gt; {
    Future&lt;Country&gt; futureAlbum;
  
    @override
    void initState() {
      super.initState();
      futureAlbum = fetchAlbum();
    }
  
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        title: 'Fetch Data Example',
        theme: ThemeData(
          primarySwatch: Colors.blue,
        ),
        home: Scaffold(
          appBar: AppBar(
            title: Text('Fetch Data Example'),
          ),
          body: Center(
            child: FutureBuilder&lt;Country&gt;(
              future: futureAlbum,
              builder: (context, snapshot) {
                if (snapshot.hasData) {
                  return Text(snapshot.data.name);
                } else if (snapshot.hasError) {
                  return Text(&quot;${snapshot.error}&quot;);
                }
  
                // By default, show a loading spinner.
                return CircularProgressIndicator();
              },
            ),
          ),
        ),
      );
    }
  }
  </code></pre>
  <p>Here is what my emulator screen looks like: <a href="http://i1.imgrr.com/18Z/7512_Screenshot1599026660.png" rel="nofollow noreferrer">http://i1.imgrr.com/18Z/7512_Screenshot1599026660.png</a></p>