fancy_credit_card_input 1.0.8 copy "fancy_credit_card_input: ^1.0.8" to clipboard
fancy_credit_card_input: ^1.0.8 copied to clipboard

A highly customizable credit card input field with support for card number, expiry date and cvv with some built in animations

codecov

Buy Me A Coffee

Have you ever wanted a Credit Card input component that has everything you need? fancy_credit_card_input have everything you need in a highly customizable component.

Demo

Features #

  • Nice colapsing animation when the card number is filled
  • Support for next focus to make it easier to input all the fields
  • Automatic brand detection while typing the card number
  • You can pass validators to all your inputs (Card Number, Expiry Date, CVV)

Getting started #

Using the component is just as simple as:

FancyCreditCardInput(
    onFormCompleted: (cardData) {
        print(cardData);
    },
    cardNumberBuilder: (brand, cardLastFourDigits) => Row(
        children: [
            _buildCardBrand(brand),
            Text('•••• $cardLastFourDigits', style: const TextStyle(fontSize: 16)),
            const SizedBox(width: 12),
        ],
    ),
    decorationBuilder: (hasFocus, hasError) => BoxDecoration(
        color: hasError ? const Color(0xFFF8E9E9) : null,
        borderRadius: const BorderRadius.all(Radius.circular(4)),
        border: Border.all(color: _getBorderColor(hasFocus, hasError)),
    ),
)

The component relies a lot in using builders so it can be as much customizable as possible.

Pretty much everything can be customizable.

Suggestions & Bugs #

For any suggestions or bug report please head to issue tracker.

1
likes
150
points
1.42k
downloads

Publisher

verified publisherrodrigobastos.dev

Weekly Downloads

A highly customizable credit card input field with support for card number, expiry date and cvv with some built in animations

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_svg, mask_text_input_formatter

More

Packages that depend on fancy_credit_card_input