CreditCardForm class

Inheritance

Constructors

CreditCardForm({Key? key, required String cardNumber, required String expiryDate, required String cardHolderName, required String cvvCode, bool obscureCvv = false, bool obscureNumber = false, required void onCreditCardModelChange(CreditCardModel), 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<String>>? cardNumberKey, GlobalKey<FormFieldState<String>>? cardHolderKey, GlobalKey<FormFieldState<String>>? expiryDateKey, GlobalKey<FormFieldState<String>>? cvvCodeKey, 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?)?, String? expiryDateValidator(String?)?, String? cvvValidator(String?)?, String? cardHolderValidator(String?)?, Function? onFormComplete, bool disableCardNumberAutoFillHints = false})
const

Properties

autovalidateMode AutovalidateMode?
Used to configure the auto validation of FormField and Form widgets.
final
cardHolderDecoration InputDecoration
Provides decoration to card holder text field.
final
cardHolderKey GlobalKey<FormFieldState<String>>?
A FormFieldState key for card holder text field.
final
cardHolderName String
A string indicating card holder name in the text field.
final
cardHolderValidator String? Function(String?)?
A validator for card holder text field.
final
cardNumber String
A string indicating card number in the text field.
final
cardNumberDecoration InputDecoration
Provides decoration to card number text field.
final
cardNumberKey GlobalKey<FormFieldState<String>>?
A FormFieldState key for card number text field.
final
cardNumberValidator String? Function(String?)?
A validator for card number text field.
final
cursorColor Color?
Cursor color in the credit card form.
final
cvvCode String
A string indicating cvv code in the text field.
final
cvvCodeDecoration InputDecoration
Provides decoration to cvv code text field.
final
cvvCodeKey GlobalKey<FormFieldState<String>>?
A FormFieldState key for cvv code text field.
final
cvvValidationMessage String
Error message string when invalid cvv is entered.
final
cvvValidator String? Function(String?)?
A validator for cvv code text field.
final
dateValidationMessage String
Error message string when invalid expiry date is entered.
final
disableCardNumberAutoFillHints bool
Setting this flag to true will disable autofill hints for Credit card number text field. Flutter has a bug when auto fill hints are enabled for credit card numbers it shows keyboard with characters. But, disabling auto fill hints will show correct keyboard.
final
enableCvv bool
Allow editing the cvv code by enabling this in the credit card form. Defaults to true.
final
expiryDate String
A string indicating expiry date in the text field.
final
expiryDateDecoration InputDecoration
Provides decoration to expiry date text field.
final
expiryDateKey GlobalKey<FormFieldState<String>>?
A FormFieldState key for expiry date text field.
final
expiryDateValidator String? Function(String?)?
A validator for expiry date text field.
final
formKey GlobalKey<FormState>
A form state key for this credit card form.
final
hashCode int
The hash code for this object.
no setterinherited
isCardNumberVisible bool
Allow editing the credit card number by enabling this in the credit card form. Defaults to true.
final
isExpiryDateVisible bool
Allows editing the expiry date by enabling this in the credit card form. Defaults to true.
final
isHolderNameVisible bool
Allow editing the holder name by enabling this in the credit card form. Defaults to true.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
numberValidationMessage String
Error message string when invalid credit card number is entered.
final
obscureCvv bool
When enabled cvv gets hidden with obscuring characters. Defaults to false.
final
obscureNumber bool
When enabled credit card number get hidden with obscuring characters. Defaults to false.
final
onCreditCardModelChange → void Function(CreditCardModel)
Provides callback when there is any change in CreditCardModel.
final
onFormComplete Function?
Provides a callback when text field provides callback in onEditingComplete.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
textColor Color
Color of text in the credit card form.
final
themeColor Color
Color of the theme of the credit card form.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → _CreditCardFormState
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited