diff --git a/icons/elo.png b/icons/elo.png new file mode 100644 index 0000000..7087c22 Binary files /dev/null and b/icons/elo.png differ diff --git a/icons/hipercard.png b/icons/hipercard.png new file mode 100644 index 0000000..63d80ad Binary files /dev/null and b/icons/hipercard.png differ diff --git a/lib/credit_card_widget.dart b/lib/credit_card_widget.dart index 6b5c076..2ea8688 100644 --- a/lib/credit_card_widget.dart +++ b/lib/credit_card_widget.dart @@ -13,6 +13,8 @@ const Map CardTypeIconAsset = { CardType.americanExpress: 'icons/amex.png', CardType.mastercard: 'icons/mastercard.png', CardType.discover: 'icons/discover.png', + CardType.elo: 'icons/elo.png', + CardType.hipercard: 'icons/hipercard.png', }; class CreditCardWidget extends StatefulWidget { @@ -505,6 +507,36 @@ class _CreditCardWidgetState extends State ['270', '271'], ['2720'], }, + CardType.elo: >{ + ['401178'], + ['401179'], + ['438935'], + ['457631'], + ['457632'], + ['431274'], + ['451416'], + ['457393'], + ['504175'], + ['506699', '506778'], + ['509000', '509999'], + ['627780'], + ['636297'], + ['636368'], + ['650031', '650033'], + ['650035', '650051'], + ['650405', '650439'], + ['650485', '650538'], + ['650541', '650598'], + ['650700', '650718'], + ['650720', '650727'], + ['650901', '650978'], + ['651652', '651679'], + ['655000', '655019'], + ['655021', '655058'] + }, + CardType.hipercard: >{ + ['606282'], + }, }; /// This function determines the Credit Card type based on the cardPatterns @@ -585,6 +617,10 @@ class _CreditCardWidgetState extends State } else { switch (ccType) { case CardType.visa: + case CardType.discover: + case CardType.mastercard: + case CardType.elo: + case CardType.hipercard: icon = Image.asset( CardTypeIconAsset[ccType]!, height: 48, @@ -604,26 +640,6 @@ class _CreditCardWidgetState extends State isAmex = true; break; - case CardType.mastercard: - icon = Image.asset( - CardTypeIconAsset[ccType]!, - height: 48, - width: 48, - package: 'flutter_credit_card', - ); - isAmex = false; - break; - - case CardType.discover: - icon = Image.asset( - CardTypeIconAsset[ccType]!, - height: 48, - width: 48, - package: 'flutter_credit_card', - ); - isAmex = false; - break; - default: icon = Container( height: 48, @@ -770,4 +786,6 @@ enum CardType { visa, americanExpress, discover, + elo, + hipercard }