title: How to render an Icon x amount of times - Flutter
body: <p>I'm pretty new to dart/flutter so apologies if this is an obvious solution but I'm trying to render an Icon for a dynamic amount of times based on a models property.</p>
  
  <p>I'm trying something like this:</p>
  
  <pre><code>Row(
    children: &lt;Widget&gt;[
       _starsForRatings()
      ],
    )
  
  List&lt;Icon&gt;_starsForRatings() {
    List&lt;Icon&gt; stars = [];
    for(int i = 0; i &lt; _rating; i++){
      stars.add(Icon(Icons.star));
    }
   return stars;
  }
  </code></pre>
  
  <p>But I'm getting the error 'The element type List can't be assigned to the list type Widget' which makes sense, however I can't think of another way to render it.</p>
  
  <p>Thanks</p>