CreditCardWidget class

Inheritance

Constructors

CreditCardWidget({Key? key, required String cardNumber, required String expiryDate, required String cardHolderName, required String cvvCode, required bool showBackView, String? bankName, Duration animationDuration = const Duration(milliseconds: 500), double? height, double? width, TextStyle? textStyle, Color cardBgColor = const Color(0xff1b447b), bool obscureCardNumber = true, bool obscureCardCvv = true, String labelCardHolder = 'CARD HOLDER', String labelExpiredDate = 'MM/YY', String labelValidThru = 'VALID\nTHRU', CardType? cardType, bool isHolderNameVisible = false, String? backgroundImage, String? backgroundNetworkImage, Glassmorphism? glassmorphismConfig, bool isChipVisible = true, bool isSwipeGestureEnabled = true, List<CustomCardTypeIcon> customCardTypeIcons = const <CustomCardTypeIcon>[], required void onCreditCardWidgetChange(CreditCardBrand), double padding = AppConstants.creditCardPadding, Color? chipColor, BoxBorder? frontCardBorder, BoxBorder? backCardBorder, bool obscureInitialCardNumber = false})
A widget showcasing credit card UI.
const

Properties

animationDuration Duration
Duration for flip animation. Defaults to 500 milliseconds.
final
backCardBorder BoxBorder?
Provides border at back of credit card widget.
final
backgroundImage String?
Shows image as background of the card widget. This should be available locally in your assets folder.
final
backgroundNetworkImage String?
Shows image as background of the card widget from the network.
final
bankName String?
A string indicating name of the bank.
final
cardBgColor Color
Applies background color for card UI.
final
cardHolderName String
A string indicating name of the card holder.
final
cardNumber String
A string indicating number on the card.
final
cardType CardType?
Sets type of the card. An small image is shown based on selected type of the card at bottom right corner. If this is set to null then image shown automatically based on credit card number.
final
chipColor Color?
Provides color to EMV chip on the card.
final
customCardTypeIcons List<CustomCardTypeIcon>
Replaces credit card image with provided widget.
final
cvvCode String
A String indicating cvv code.
final
expiryDate String
A string indicating expiry date for the card.
final
frontCardBorder BoxBorder?
Provides border in front of credit card widget.
final
glassmorphismConfig Glassmorphism?
Used to provide glassmorphism effect to credit card widget.
final
hashCode int
The hash code for this object.
no setterinherited
height double?
Sets height of the front and back side of the card.
final
isChipVisible bool
Enable/disable showcasing EMV chip UI. Defaults to true.
final
isHolderNameVisible bool
Enable/disable card holder name. Defaults to false.
final
isSwipeGestureEnabled bool
Enable/disable gestures on credit card widget. If enabled then flip animation is started when swiped or tapped. Defaults to true.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
labelCardHolder String
Default label for card holder name. This is shown when user hasn't entered any text for card holder name.
final
labelExpiredDate String
Default label for expiry date. This is shown when user hasn't entered any text for expiry date.
final
labelValidThru String
Default label for valid thru. This is shown when user hasn't entered any text for valid thru.
final
obscureCardCvv bool
If this flag is enabled then cvv is replaced with obscuring characters to hide the content. Defaults to true.
final
obscureCardNumber bool
If this flag is enabled then card number is replaced with obscuring characters to hide the content. Initial 4 and last 4 character doesn't get obscured. Defaults to true.
final
obscureInitialCardNumber bool
Also obscures initial 4 card numbers with obscuring characters. This flag requires obscureCardNumber to be true. This flag defaults to false.
final
onCreditCardWidgetChange → void Function(CreditCardBrand)
Provides a callback any time there is a change in credit card brand.
final
padding double
Provides equal padding inside the credit card widget in all directions. Defaults to 16.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showBackView bool
Shows back side of the card at initial level when setting it to true. This is helpful when focusing on cvv.
final
textStyle TextStyle?
Applies text style to cardNumber, expiryDate, cardHolderName and cvvCode.
final
width double?
Sets width of the front and back side of the card.
final

Methods

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