CreditCardWidget constructor

const CreditCardWidget({
  1. required String cardNumber,
  2. required String expiryDate,
  3. required String cardHolderName,
  4. required String cvvCode,
  5. required bool showBackView,
  6. required CCBrandChangeCallback onCreditCardWidgetChange,
  7. String? bankName,
  8. Duration animationDuration = AppConstants.defaultAnimDuration,
  9. double? height,
  10. double? width,
  11. TextStyle? textStyle,
  12. Color cardBgColor = AppConstants.defaultCardBgColor,
  13. bool obscureCardNumber = true,
  14. bool obscureCardCvv = true,
  15. String labelCardHolder = AppConstants.cardHolderCaps,
  16. String labelExpiredDate = AppConstants.expiryDateShort,
  17. String labelValidThru = AppConstants.validThru,
  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. double padding = AppConstants.creditCardPadding,
  27. Color? chipColor,
  28. BoxBorder? frontCardBorder,
  29. BoxBorder? backCardBorder,
  30. bool obscureInitialCardNumber = false,
  31. bool enableFloatingCard = false,
  32. FloatingConfig floatingConfig = const FloatingConfig(),
  33. Key? key,
})

A widget showcasing credit card UI.

Implementation

const CreditCardWidget({
  required this.cardNumber,
  required this.expiryDate,
  required this.cardHolderName,
  required this.cvvCode,
  required this.showBackView,
  required this.onCreditCardWidgetChange,
  this.bankName,
  this.animationDuration = AppConstants.defaultAnimDuration,
  this.height,
  this.width,
  this.textStyle,
  this.cardBgColor = AppConstants.defaultCardBgColor,
  this.obscureCardNumber = true,
  this.obscureCardCvv = true,
  this.labelCardHolder = AppConstants.cardHolderCaps,
  this.labelExpiredDate = AppConstants.expiryDateShort,
  this.labelValidThru = AppConstants.validThru,
  this.cardType,
  this.isHolderNameVisible = false,
  this.backgroundImage,
  this.backgroundNetworkImage,
  this.glassmorphismConfig,
  this.isChipVisible = true,
  this.isSwipeGestureEnabled = true,
  this.customCardTypeIcons = const <CustomCardTypeIcon>[],
  this.padding = AppConstants.creditCardPadding,
  this.chipColor,
  this.frontCardBorder,
  this.backCardBorder,
  this.obscureInitialCardNumber = false,
  this.enableFloatingCard = false,
  this.floatingConfig = const FloatingConfig(),
  super.key,
});