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,
),
),
],
);
}),
),
我有一个问题添加按钮的右侧行。我尝试使用MainAxisAlignment.和alignment:对齐,没错,但没成功.
3条答案
按热度按时间b5buobof1#
希望这对你有帮助。
ffx8fchx2#
希望这对你有帮助。将其 Package 对齐。
sulc1iza3#
您可以通过使用行和间隔小部件来实现这一点。