Trying a 'like button' within a Future builder with many other widgets as below ,
onPressed: () {
if (aleadyLiked.length > 0) {
unlike(profileId);
} else {
like(profileId);
}
setState(() {});
},
And this is how my future builder starts,
@override
Widget build(BuildContext context) {
return FutureBuilder(
future: getProfile(profileId),
builder: (context, snapshot) {
=======Other widgets here======
}
Issue is onPressed of the like icon-button I am doing the setState() which is causing the whole Future builder to reload , Is there a way just to update the Like Button and the Like count , I was thinking to use some client side counter logic which callbacks to actual DB updates .Please help.
Loading Profile part on initState() can be achieved, but how to handle updating and reflecting 'Likes' , can that Like-button region alone be reloaded ?