title: Flutter toList() is making a list of <dynamic> type
body: <p>I'm trying to render a list of widgets. To do this, I'm creating a list of RowDataEntry objects that looks like this:</p>
  <pre><code>class RowDataEntry {
    final Map&lt;String, dynamic&gt; values;
  
    RowDataEntry(this.values);
  }
  </code></pre>
  <p>I then want to instantiate the list of entries like this like this:</p>
  <pre><code>final List&lt;RowDataEntry&gt; data = args['data'].subFunds.map((subFund) {
        final name = subFund.parameters[&quot;subFundName&quot;];
        return RowDataEntry({&quot;fundName&quot;: name, &quot;status&quot;: Status('pass')});
      }).toList();
  </code></pre>
  <p>However, the &quot;toList()&quot; converts the list into a list of type dynamic, rather than of type RowDataEntry, and so I'm getting a compilation error.</p>
  <p>I've tried casting but I can't get it to work. It would be great if someone could show me where I'm going wrong.</p>
  <p>Thanks.</p>
  <p>EDIT======================</p>
  <p>I think the issue is with the args object. It looks like this:</p>
  <pre><code>final Map&lt;String, dynamic&gt; args = ModalRoute.of(context).settings.arguments;
  </code></pre>