brandImage method

AssetImage brandImage(
  1. String brand
)

Implementation

static AssetImage brandImage(String brand) {
  if (brand != null) {
    switch (brand.toLowerCase()) {
      case 'amex':
        return AssetImage('assets/ic_amex.png');
      case 'master':
      case 'mastercard':
      case 'maestro':
        return AssetImage('assets/ic_mastercard.png');
      case 'diners':
      case 'discover':
        return AssetImage('assets/ic_discover.png');
      case 'jcb':
        return AssetImage('assets/ic_jcb.png');
      case 'elo':
        return AssetImage('assets/ic_elo.png');
      case 'hipercard':
        return AssetImage('assets/ic_hipercard.png');
      case 'sorocred':
        return AssetImage('assets/ic_sorocred.png');
      case 'credsystem':
        return AssetImage('assets/ic_credsystem.png');
      default:
        return AssetImage('assets/ic_visa.png');
    }
  } else {
    return AssetImage('assets/ic_visa.png');
  }
}