getCardTypeIcon method

String getCardTypeIcon(
  1. String cardNumber
)

Implementation

String getCardTypeIcon(String cardNumber) {
  String icon;
  switch (detectCCType(cardNumber)) {
    case BandeiraCartao.visa:
      icon = 'assets/img/icons/visa.png';
      break;

    case BandeiraCartao.americanExpress:
      icon = 'assets/img/icons/amex.png';
      break;

    case BandeiraCartao.mastercard:
      icon = 'assets/img/icons/mastercard.png';
      break;

    case BandeiraCartao.discover:
      icon = 'assets/img/icons/discover.png';
      break;

    default:
      icon = '';
      break;
  }

  return icon;
}