title: How can i return a list of widgets using map function in flutter
body: <p>I created a list of widgets...</p>
  <pre><code>`List&lt;Widget&gt; commWidgets = [
  Card(
    color: Colors.blueGrey[200],
    child: Column(
      children: &lt;Widget&gt;[
        Text('Commodity 1'),
        Row(
          children: &lt;Widget&gt;[
            Text('Opening Stock'),
            Text('Bought/Sold'),
            Text('Closing Stock')
          ],
        )
      ],
    ),
  ),
  Card(
    color: Colors.blueGrey[300],
    child: Column(
      children: &lt;Widget&gt;[
        Text('Commodity 2'),
        Row(
          children: &lt;Widget&gt;[
            Text('Opening Stock'),
            Text('Bought/Sold'),
            Text('Closing Stock')
          ],
        )
      ],
    ),
  ),
  Card(
    color: Colors.blueGrey[200],
    child: Column(
      children: &lt;Widget&gt;[
        Text('Commodity 3'),
        Row(
          children: &lt;Widget&gt;[
            Text('Opening Stock'),
            Text('Bought/Sold'),
            Text('Closing Stock')
          ],
        )
      ],
    ),
  ),
  </code></pre>
  <p>];
  `</p>
  <p>and then i tried returning it using this line of code in my body property</p>
  <pre><code>Column(
      children: commWidgets.map((commWidget) =&gt; Widget(commWidget)).toList(),
    ),
  </code></pre>
  <p>but it fails with the error:
  Compiler message:
  lib/main.dart:70:51: Error: The class 'Widget' is abstract and can't be instantiated.
  children: commWidgets.map((commWidget) =&gt; Widget(commWidget)).toList(),
  ^^^^^^</p>