updateLogo method

void updateLogo(
  1. String number
)

Implementation

void updateLogo(String number) {
  var types = detectCCType(number);

  if (number.isNotEmpty) {
    if (types.contains(CreditCardType.visa())) {
      logo.value = '/Users/ashfaq/packages/bank_card_ui/assets/images/visa.png';
    } else if (types.contains(CreditCardType.mastercard())) {
      logo.value = '/Users/ashfaq/packages/bank_card_ui/assets/images/master.png';
    } else if (types.contains(CreditCardType.americanExpress())) {
      logo.value = '/Users/ashfaq/packages/bank_card_ui/assets/images/amex.png';
    } else if (types.contains(CreditCardType.discover())) {
      logo.value = '/Users/ashfaq/packages/bank_card_ui/assets/images/discover.png';
    } else if (types.contains(CreditCardType.jcb())) {
      logo.value = '/Users/ashfaq/packages/bank_card_ui/assets/images/jcb.png';
    } else if (types.contains(CreditCardType.dinersClub())) {
      logo.value = '/Users/ashfaq/packages/bank_card_ui/assets/images/diners.png';
    } else {
      logo.value = '/Users/ashfaq/packages/bank_card_ui/assets/images/default.png';
    }
  }
}