title: List<dynamic>' is not a subtype of type 'List<Obj>' in type cast
body: <p>I am trying to create dynamic drop down, whose values are populating from one of the lookup table using micro-services, but i have tried same in many ways till now i have not succeed for making it work. as i am totally new to dart/flutter
  So can anyone please identify what i have done wrong in below code </p>
  
  <p><strong>below code is for calling webservice</strong> </p>
  
  <pre><code>Future&lt;List&lt;CountryDropDownList&gt;&gt; getCountriesDetails(String url) async{
      HttpClient httpClient = new HttpClient();
      HttpClientRequest request = await httpClient.getUrl(Uri.parse(url));
      // request.headers.set('content-type', 'application/json');
      print("request data "+request.toString());
      HttpClientResponse microServicesResponse= await request.close();
      String microServicesResponseString = await microServicesResponse.transform(utf8.decoder).join();
      final parsed = await json.decode(microServicesResponseString).cast&lt;Map&lt;String, dynamic&gt;&gt;();
      httpClient.close();
      print("Data Recieved   "+microServicesResponseString.toString());
      return parsed
          .map&lt;CountryDropDownList&gt;(
              (json) =&gt; CountryDropDownList.fromJson(json))
          .toList();
    }
  </code></pre>
  
  <p>Here is my object type</p>
  
  <pre><code>class CountryDropDownList{
  
    String countryName;
    List&lt;StateDropDownList&gt; stateDropDownList;
  
  
    CountryDropDownList({this.countryName, this.stateDropDownList});
  
    factory CountryDropDownList.fromJson(Map&lt;String, dynamic&gt; json) {
      return CountryDropDownList(
        countryName: json['countryName'] as String,
        stateDropDownList: json['states'] as List&lt;StateDropDownList&gt;,
      );
    }
  }
  </code></pre>
  
  <p><strong>and just for displaying as of now running below code</strong> </p>
  
  <pre><code>    class CenterFoundationSubmission extends StatefulWidget  {
        CenterFoundationSubmission({Key key}) : super(key: key);
  
        @override
        _CenterFoundationSubmissionState createState() =&gt; new _CenterFoundationSubmissionState();
      }
  
      class _CenterFoundationSubmissionState extends State&lt;CenterFoundationSubmission&gt; {
  
        NetworkUtil _netUtil = new NetworkUtil();
  
        var url = "SomeUrl";
  
        @override
        void initState() {
          super.initState();
          setState(() {
          });
        }
  
  
        @override
        Widget build(BuildContext context) {
          var futureBuilder = new FutureBuilder(
            future: _getData(),
            builder: (BuildContext context, AsyncSnapshot snapshot) {
              switch (snapshot.connectionState) {
                case ConnectionState.none:
                case ConnectionState.waiting:
                  return new Text('loading...');
                default:
                  if (snapshot.hasError)
                    return new Text('Exception here is : ${snapshot.error}');
                  else
                    return createView(context, snapshot);
              }
            },
          );
  
          return new Scaffold(
            appBar: new AppBar(
              title: new Text("Center Foundation"),
            ),
            body: futureBuilder,
          );
  
        }
  
        Future&lt;List&lt;CountryDropDownList&gt;&gt; _getData() async {
          List&lt;CountryDropDownList&gt; values = new List&lt;CountryDropDownList&gt;();
          values.addAll(_netUtil.getCountriesDetails(url) as List&lt;CountryDropDownList&gt;);
  
  /*Error Added here , i am getting error while casting list to my object type*/
  
  
          await new Future.delayed(new Duration(seconds: 10));
  
          return values;
        }
  
        Widget createView(BuildContext context, AsyncSnapshot snapshot) {
          List&lt;CountryDropDownList&gt; values = snapshot.data;
          return new ListView.builder(
            itemCount: values.length,
            itemBuilder: (BuildContext context, int index) {
              return new Column(
                children: &lt;Widget&gt;[
                  new ListTile(
                    title: new Text(values[index].countryName),
                    subtitle:  new Text(values[index].stateDropDownList[index].statesName),
                    trailing:   new Text(values[index].stateDropDownList[index].districtDropDownList[index].districtsName),
                  ),
                  new Divider(height: 2.0,),
                ],
              );
            },
          );
        }
      }
  </code></pre>
  
  <p>What i have done i have tried calling webservices in multiple ways for calling it, Tried casting services response directly using JSON string response and may thing i have tried.</p>
  
  <p>Could you please help here, help will be appreciated.</p>