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. required TextStyle textStyle,
  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. String cvvValidationMessage = 'Please input a valid CVV',
  18. String dateValidationMessage = 'Please input a valid date',
  19. String numberValidationMessage = 'Please input a valid number',
  20. bool isHolderNameVisible = true,
  21. bool isCardNumberVisible = true,
  22. bool isExpiryDateVisible = true,
})

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,
  required this.textStyle,
  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.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,
}) : super(key: key);