title: Do a for each loop in a folder in flutter
body: <p>I have a folder with csv files. For now I have to go manually and write manually each file. Is it somehow to get all the files and do a for loop? This is the current code I have and thank you so much!</p>
  
  <pre><code>static List&lt;Widget&gt; getPlates(String file) {
      List&lt;Widget&gt; listWidgets = [];
      loadAsset('assets/$file.csv').then((dynamic output) {
        List&lt;String&gt; list = output.split('\n');
        for (int i = 1; i &lt; list.length - 1; i++) {
          List&lt;String&gt; sublist = list[i].split(';');
          listWidgets.add(CardPlate(
            name: sublist[0],
            ingredients: sublist[1],
            price: sublist[2],
          ));
        }
      });
  
      return listWidgets;
    }
  
    static Future&lt;String&gt; loadAsset(String path) async {
      return await rootBundle.loadString(path);
    }
  </code></pre>