36 likes
·
312 reads
2 comments
·May 3, 2023
May 3, 2023
Hi, I have a doubt about why you use Future.wait(userFutures), instead, we can await the future in the above line userFutures=await userIds.map((id) => getUserData(id));
1
·
·1 reply
Author
·Jul 19, 2023
Thank you for asking Aman.
Whenever you wants to get the response together from multiple things, you can use wait. It will wait for all the actions and once all the actions will complete their tasks, the Future.wait() will return the combined values.
·