title: how to use foreach method in flutter
body: <p>this is my submit function every things is fine but  _imagesAssets.forEach not run and _images list will be null.any idea will be greate</p>
  <pre><code>if (_formKey.currentState.validate()) {
        _images.clear();
        _imagesAssets.forEach((element) async {
          _images.add(await getImageFileFromAssets(element));
        });
        PersianDateTime persianDate1 =
            PersianDateTime(jalaaliDateTime: dateTextController.text);
        persianDate1.toGregorian();
  
        _preferences = await SharedPreferences.getInstance();
        String _apiToken = _preferences.getString('apiToken');
  
        TransactionAddDto transactionAddDto = new TransactionAddDto(
          isCharity: _isCharity,
          payDate: persianDate1.datetime.toString().replaceFirst(&quot; &quot;, &quot;T&quot;),
          imageArray: _images,
          apiToken: _apiToken,
          userId: _selectedUser,
          payVal: _transactionVal.toDouble(),
        );
        _transactionBloc.add(
          new AddTransactionEvent(transactionAddDto),
        );
      }
  </code></pre>