CreditCardForm class

Inheritance

Constructors

CreditCardForm({required String cardNumber, required String expiryDate, required String cardHolderName, required String cvvCode, required CCModelChangeCallback onCreditCardModelChange, required GlobalKey<FormState> formKey, bool obscureCvv = false, bool obscureNumber = false, InputConfiguration inputConfiguration = const InputConfiguration(), GlobalKey<FormFieldState<String>>? cardNumberKey, GlobalKey<FormFieldState<String>>? cardHolderKey, GlobalKey<FormFieldState<String>>? expiryDateKey, GlobalKey<FormFieldState<String>>? cvvCodeKey, String cvvValidationMessage = AppConstants.cvvValidationMessage, String dateValidationMessage = AppConstants.dateValidationMessage, String numberValidationMessage = AppConstants.numberValidationMessage, bool isHolderNameVisible = true, bool isCardNumberVisible = true, bool isExpiryDateVisible = true, bool enableCvv = true, AutovalidateMode? autovalidateMode, ValidationCallback? cardNumberValidator, ValidationCallback? expiryDateValidator, ValidationCallback? cvvValidator, ValidationCallback? cardHolderValidator, Function? onFormComplete, bool disableCardNumberAutoFillHints = false, Key? key})
const

Properties

autovalidateMode AutovalidateMode?
Used to configure the auto validation of FormField and Form widgets.
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 → ValidationCallback?
A validator for card holder text field.
final
cardNumber String
A string indicating card number in the text field.
final
cardNumberKey GlobalKey<FormFieldState<String>>?
A FormFieldState key for card number text field.
final
cardNumberValidator → ValidationCallback?
A validator for card number text field.
final
cvvCode String
A string indicating cvv code in the 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 → ValidationCallback?
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
expiryDateKey GlobalKey<FormFieldState<String>>?
A FormFieldState key for expiry date text field.
final
expiryDateValidator → ValidationCallback?
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
inputConfiguration InputConfiguration
Provides InputDecoration and TextStyle to CreditCardForm's TextField.
final
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 → CCModelChangeCallback
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

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<CreditCardForm>
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