We tried your sample code. It makes no difference. Even with a 5 seconds delay.
It is similar with comments: Adding a comment via amityPosts[index].comment().create().text("text1").send()
updates latestCommentsIds but not latestComments and commentCount of a post.
Hello, our team has released the enhancement to handle this issue in Flutter sdk ver 0.12.0, please let us know if you have further questions. Thank you
Hi, we updated to SDK 0.12.0. Unfortunately, we cannot notice any change in the behavior described earlier? MyReactions and latestComments still do not update immediately.
you can use stream builder to listen to the updated in Amity Post object. so when ever there is any update, you will get an event with latest amity post object with update my reaction and latest comments.
StreamBuilder<AmityPost>(
stream: amityPost.listen.stream,
initialData: amityPost,
builder: (context, snapshot) {
/// Snapshot will always updated object
final value = snapshot.data;
},
)
Another Approach we added in SDK 0.12.0, in case you dont want to use Streambuilder or have nested widgets, future return from the addReaction will always have latest Amity Post Object with my reaction and reactions.