CreditCardForm constructor

const CreditCardForm({
  1. Key? key,
  2. required String cardNumber,
  3. required String expiryDate,
  4. required String cardHolderName,
  5. required String cvvCode,
  6. bool obscureCvv = false,
  7. bool obscureNumber = false,
  8. required void onCreditCardModelChange(
    1. CreditCardModel
    ),
  9. required Color themeColor,
  10. Color textColor = Colors.black,
  11. Color? cursorColor,
  12. InputDecoration cardHolderDecoration = const InputDecoration(labelText: 'Card holder'),
  13. InputDecoration cardNumberDecoration = const InputDecoration(labelText: 'Card number', hintText: 'XXXX XXXX XXXX XXXX'),
  14. InputDecoration expiryDateDecoration = const InputDecoration(labelText: 'Expired Date', hintText: 'MM/YY'),
  15. InputDecoration cvvCodeDecoration = const InputDecoration(labelText: 'CVV', hintText: 'XXX'),
  16. required GlobalKey<FormState> formKey,
  17. GlobalKey<FormFieldState<String>>? cardNumberKey,
  18. GlobalKey<FormFieldState<String>>? cardHolderKey,
  19. GlobalKey<FormFieldState<String>>? expiryDateKey,
  20. GlobalKey<FormFieldState<String>>? cvvCodeKey,
  21. String cvvValidationMessage = 'Please input a valid CVV',
  22. String dateValidationMessage = 'Please input a valid date',
  23. String numberValidationMessage = 'Please input a valid number',
  24. bool isHolderNameVisible = true,
  25. bool isCardNumberVisible = true,
  26. bool isExpiryDateVisible = true,
  27. bool enableCvv = true,
  28. AutovalidateMode? autovalidateMode,
  29. String? cardNumberValidator(
    1. String?
    )?,
  30. String? expiryDateValidator(
    1. String?
    )?,
  31. String? cvvValidator(
    1. String?
    )?,
  32. String? cardHolderValidator(
    1. String?
    )?,
  33. Function? onFormComplete,
  34. bool disableCardNumberAutoFillHints = false,
})

Implementation

const CreditCardForm({
  Key? key,
  required this.cardNumber,
  required this.expiryDate,
  required this.cardHolderName,
  required this.cvvCode,
  this.obscureCvv = false,
  this.obscureNumber = false,
  required this.onCreditCardModelChange,
  required this.themeColor,
  this.textColor = Colors.black,
  this.cursorColor,
  this.cardHolderDecoration = const InputDecoration(
    labelText: 'Card holder',
  ),
  this.cardNumberDecoration = const InputDecoration(
    labelText: 'Card number',
    hintText: 'XXXX XXXX XXXX XXXX',
  ),
  this.expiryDateDecoration = const InputDecoration(
    labelText: 'Expired Date',
    hintText: 'MM/YY',
  ),
  this.cvvCodeDecoration = const InputDecoration(
    labelText: 'CVV',
    hintText: 'XXX',
  ),
  required this.formKey,
  this.cardNumberKey,
  this.cardHolderKey,
  this.expiryDateKey,
  this.cvvCodeKey,
  this.cvvValidationMessage = 'Please input a valid CVV',
  this.dateValidationMessage = 'Please input a valid date',
  this.numberValidationMessage = 'Please input a valid number',
  this.isHolderNameVisible = true,
  this.isCardNumberVisible = true,
  this.isExpiryDateVisible = true,
  this.enableCvv = true,
  this.autovalidateMode,
  this.cardNumberValidator,
  this.expiryDateValidator,
  this.cvvValidator,
  this.cardHolderValidator,
  this.onFormComplete,
  this.disableCardNumberAutoFillHints = false,
}) : super(key: key);