gpt4 book ai didi

flutter - 如何在flutter中使用foreach方法

转载 作者:行者123 更新时间:2023-12-05 03:38:54 27 4
gpt4 key购买 nike

<分区>

这是我的提交功能,一切正常,但 _imagesAssets.forEach 未运行且 _images 列表将为空。任何想法都会很棒

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(" ", "T"),
imageArray: _images,
apiToken: _apiToken,
userId: _selectedUser,
payVal: _transactionVal.toDouble(),
);
_transactionBloc.add(
new AddTransactionEvent(transactionAddDto),
);
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com