Reputation: 87
I am trying to create a like button (using like_button library) that also has to show the number of likes next to it however my icon is stacked on top of the number of likes, how can I create some space between them?
Expanded(
child: LikeButton(
size: 15,
likeCount: 0,
likeBuilder: (bool like) {
return Icon(
Icons.thumb_up,
color: Colors.red,
);
},
), //Text("Liked"),
),
Upvotes: 0
Views: 1447
Reputation: 787
You can either wrap your Icon
with a Padding
widget:
LikeButton(
size: 30,
likeCount: 0,
likeBuilder: (bool like) {
return Padding(
padding: const EdgeInsets.all(4.0)
child: Icon(
Icons.thumb_up,
color: Colors.red,
),
);
},
),
or use the likeCountPadding
property already defined in the LikeButton
:
LikeButton(
size: 15,
likeCount: 0,
likeCountPadding: const EdgeInsets.all(4.0)
likeBuilder: (bool like) {
return Icon(
Icons.thumb_up,
color: Colors.red,
);
},
),
Upvotes: 2