I want to fetch a list of Posts and display them in a ListView, each element of this ListView contains a title,body, and the userImage. these data will comes from two different end points from the well known jsonplaceholder https://jsonplaceholder.typicode.com/posts
and https://jsonplaceholder.typicode.com/users
I have already made the Post and the User models. should I create another PostWithUser model? or what?
so what is the efficient way to combine these two http requests?
Sorry for my bad English.
You can try with Future.wait. refer the following documentation
https://api.dart.dev/stable/2.5.0/dart-async/Future/wait.html
Eg. Future.wait([apiCall1(), apiCall2()])
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments