OutlinedButton(
onPressed: () async {},
child: MaterialButton(
onPressed: () async {
updateFavoriteStatus(
context: context,
isFavorite: isFavorite,
product: product,
);
},
height: getProportionateScreenHeight(0.0566),
color: AppColors.kPrimaryColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(25),
),
child: Consumer<Product>(builder: (context, prod, ch) {
final isFavorite =
Provider.of<Favorites>(context, listen: false)
.isFavoriteOrNot(prod.id);
final productLikes = prod.likes!;
return Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
InkWell(
onTap: tryUpdateFavoriteStatus,
child: Icon(
CupertinoIcons.heart_fill,
color: isFavorite
? AppColors.philippineSilver
: AppColors.white,
),
),
SizedBox(
width: getProportionateScreenWidth(0.15),
),
Text(
'$productLikes ',
style:
Theme.of(context).textTheme.bodyMedium!.copyWith(
color: AppColors.white,
),
),
],
);
}),
),
I have an issue adding button to right side of the row. I tried using MainAxisAlignment.and alignment: Alignment.right but it didn’t work.
2
Answers
Hope this may help you.
Hope this helps you. wrap it will Align.