fluttercandies/like_button

Add likeCount param in countDecoration

Closed this issue · 4 comments

Add int likeCount param in countDecoration property for us to know the real count and for us to do some logic depending on the like count.

   countDecoration: (Widget count, int likeCount) {
        return Row(
          mainAxisAlignment: MainAxisAlignment.center,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: <Widget>[
            count,
            SizedBox(width: 5),
            Text(
              likeCount > 1 ? "Likes" : "Like",
              style: TextStyle(color: white.withOpacity(0.7), fontSize: 12),
            ),
          ],
        );
      },

like count is ready known from your side

how and where? or how to get the count value from countDecoration property?

why should we must get it from countDecoration ? like count is from your data, you already know it .