fluttercandies / like_button

Like Button is a flutter library that allows you to create a button with animation effects similar to Twitter's heart when you like something and animation effects to increase like count.
MIT License
469 stars 96 forks source link

The package breaks when 2 requests are sent at a time #74

Open rabinacharya11 opened 1 year ago

rabinacharya11 commented 1 year ago

The package will not work the way it is expected to work when 2 request. for eg : likePost() refreshFeeds()

are sent

zmtzawqlp commented 1 year ago

a simple runnable demo will better

rabinacharya11 commented 1 year ago

I custom-coded the features I wanted. I didn't have a demo video

but here is how it breaks :

LikeButton( onTap: onLikeButtonTapped, ),

` Future<bool> onLikeButtonTapped(bool isLiked) async{
/// send your request here
// final bool success= await sendRequest(); 

///. When i added another request in this function whole lists of the posts started acting wried!

/// if failed, you can do nothing
// return success? !isLiked:isLiked;

return !isLiked;

}`

zmtzawqlp commented 1 year ago

if your request is slow, maybe you should not await it

rabinacharya11 commented 1 year ago

That's when the package gives a lot of errors