add async

This commit is contained in:
Inex Code 2022-04-21 06:46:41 +00:00
parent ca6e8b28de
commit 473828f498

View file

@ -106,7 +106,7 @@ Future<void> _postOnMastodon(reqJson) async {
options: dio_lib.Options(headers: {'Authorization': 'Bearer $authToken'})); options: dio_lib.Options(headers: {'Authorization': 'Bearer $authToken'}));
} else { } else {
final mediaResponses = await Future.wait( final mediaResponses = await Future.wait(
photoUrls.map((photoUrl) => dio.post('$instanceUrl/api/v1/media', photoUrls.map((photoUrl) async => dio.post('$instanceUrl/api/v1/media',
data: dio_lib.FormData.fromMap({'file': File(photoUrl)}), data: dio_lib.FormData.fromMap({'file': File(photoUrl)}),
options: dio_lib.Options(headers: {'Authorization': 'Bearer $authToken'})))); options: dio_lib.Options(headers: {'Authorization': 'Bearer $authToken'}))));