CreditCardForm constructor
const
CreditCardForm({
- Key? key,
- required String cardNumber,
- required String expiryDate,
- required String cardHolderName,
- required String cvvCode,
- bool obscureCvv = false,
- bool obscureNumber = false,
- required void onCreditCardModelChange(),
- required Color themeColor,
- Color textColor = Colors.black,
- Color? cursorColor,
- InputDecoration cardHolderDecoration = const InputDecoration(labelText: 'Card holder'),
- InputDecoration cardNumberDecoration = const InputDecoration(labelText: 'Card number', hintText: 'XXXX XXXX XXXX XXXX'),
- InputDecoration expiryDateDecoration = const InputDecoration(labelText: 'Expired Date', hintText: 'MM/YY'),
- InputDecoration cvvCodeDecoration = const InputDecoration(labelText: 'CVV', hintText: 'XXX'),
- required GlobalKey<
FormState> formKey, - GlobalKey<
FormFieldState< ? cardNumberKey,String> > - GlobalKey<
FormFieldState< ? cardHolderKey,String> > - GlobalKey<
FormFieldState< ? expiryDateKey,String> > - GlobalKey<
FormFieldState< ? cvvCodeKey,String> > - String cvvValidationMessage = 'Please input a valid CVV',
- String dateValidationMessage = 'Please input a valid date',
- String numberValidationMessage = 'Please input a valid number',
- bool isHolderNameVisible = true,
- bool isCardNumberVisible = true,
- bool isExpiryDateVisible = true,
- bool enableCvv = true,
- AutovalidateMode? autovalidateMode,
- String? cardNumberValidator()?,
- String? expiryDateValidator()?,
- String? cvvValidator()?,
- String? cardHolderValidator()?,
- Function? onFormComplete,
- 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);