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, - String cvvValidationMessage = 'Please input a valid CVV',
- String dateValidationMessage = 'Please input a valid date',
- String numberValidationMessage = 'Please input a valid number',
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.cvvValidationMessage = 'Please input a valid CVV',
this.dateValidationMessage = 'Please input a valid date',
this.numberValidationMessage = 'Please input a valid number',
}) : super(key: key);