getCardIcon static method
Implementation
static Widget? getCardIcon(CardType? cardType) {
String img = "";
Icon? icon;
switch (cardType) {
case CardType.Master:
img = 'img_mastercard.png';
break;
case CardType.Visa:
img = 'img_visa.png';
break;
case CardType.Verve:
img = 'img_verve.png';
break;
case CardType.AmericanExpress:
img = 'img_amex.png';
break;
case CardType.Discover:
img = 'img_discover.png';
break;
case CardType.DinersClub:
img = 'img_dinners_club.png';
break;
case CardType.Jcb:
img = 'img_jcb.png';
break;
case CardType.Others:
icon = Icon(
Icons.credit_card,
size: 24.0,
color: AppColors.inActivButtonColor(),
);
break;
default:
icon = Icon(
Icons.credit_card,
size: 40.0,
color: AppColors.inActivButtonColor(),
);
break;
}
Widget? widget;
if (img.isNotEmpty) {
widget = Image.asset(
'assets/images/$img',
width: 40.0,
package: 'deposits_oneclick_checkout'
);
} else {
widget = icon;
}
return widget;
}