CreditCardWidget constructor

const CreditCardWidget({
  1. Key? key,
  2. required String cardNumber,
  3. required String expiryDate,
  4. required String cardHolderName,
  5. required String cvvCode,
  6. required bool showBackView,
  7. String? bankName,
  8. Duration animationDuration = const Duration(milliseconds: 500),
  9. double? height,
  10. double? width,
  11. TextStyle? textStyle,
  12. Color cardBgColor = const Color(0xff1b447b),
  13. bool obscureCardNumber = true,
  14. bool obscureCardCvv = true,
  15. String labelCardHolder = 'CARD HOLDER',
  16. String labelExpiredDate = 'MM/YY',
  17. String labelValidThru = 'VALID\nTHRU',
  18. CardType? cardType,
  19. bool isHolderNameVisible = false,
  20. String? backgroundImage,
  21. String? backgroundNetworkImage,
  22. Glassmorphism? glassmorphismConfig,
  23. bool isChipVisible = true,
  24. bool isSwipeGestureEnabled = true,
  25. List<CustomCardTypeIcon> customCardTypeIcons = const <CustomCardTypeIcon>[],
  26. required void onCreditCardWidgetChange(
    1. CreditCardBrand
    ),
  27. double padding = AppConstants.creditCardPadding,
  28. Color? chipColor,
  29. BoxBorder? frontCardBorder,
  30. BoxBorder? backCardBorder,
  31. bool obscureInitialCardNumber = false,
})

A widget showcasing credit card UI.

Implementation

const CreditCardWidget({
  Key? key,
  required this.cardNumber,
  required this.expiryDate,
  required this.cardHolderName,
  required this.cvvCode,
  required this.showBackView,
  this.bankName,
  this.animationDuration = const Duration(milliseconds: 500),
  this.height,
  this.width,
  this.textStyle,
  this.cardBgColor = const Color(0xff1b447b),
  this.obscureCardNumber = true,
  this.obscureCardCvv = true,
  this.labelCardHolder = 'CARD HOLDER',
  this.labelExpiredDate = 'MM/YY',
  this.labelValidThru = 'VALID\nTHRU',
  this.cardType,
  this.isHolderNameVisible = false,
  this.backgroundImage,
  this.backgroundNetworkImage,
  this.glassmorphismConfig,
  this.isChipVisible = true,
  this.isSwipeGestureEnabled = true,
  this.customCardTypeIcons = const <CustomCardTypeIcon>[],
  required this.onCreditCardWidgetChange,
  this.padding = AppConstants.creditCardPadding,
  this.chipColor,
  this.frontCardBorder,
  this.backCardBorder,
  this.obscureInitialCardNumber = false,
}) : super(key: key);