title: How to convert an array of data to a list of widgets with expand or fold in flutter/dart?
body: <p>Really frustrated about not solving it myself but finally gave up.
  I have an array of fields, each being a map with title and value. I want to iterate through it and create a list of text widgets along with some padding between them. I tried the following:</p>
  <pre><code>fields.expand((field)=&gt;
                    [ Text(field['title']), 
                      Padding(padding: const EdgeInsets.only(bottom: 4.0))
                    ]
               ).toList()
  </code></pre>
  <p>But this gives the following error:</p>
  <pre><code>type 'List&lt;dynamic&gt;' is not a subtype of type 'List&lt;Widget&gt;'
  </code></pre>
  <p>I tried adding <code>&lt;Widget&gt;</code> after <code>expand</code> but then I get:</p>
  <pre><code>type 'MappedListIterable&lt;Map&lt;String, String&gt;, dynamic&gt;' is not a subtype of type 'List&lt;Widget&gt;'
  </code></pre>
  <p>I also tried adding <code>&lt;Widget&gt;</code> after <code>expand(</code> but then I get:</p>
  <pre><code>type '&lt;Widget&gt;(dynamic) =&gt; List&lt;Widget&gt;' is not a subtype of type '(Map&lt;String, String&gt;) =&gt; Iterable&lt;dynamic&gt;' of 'f'
  </code></pre>
  <p>Not sure what else to do. How the heck can I force it to realize this is a list of widgets?
  I also tried using fold but got similar typing issues.</p>