CardExpiryMask class
Formatter de campo para data de validade de cartão.
Suporta dois formatos de forma dinâmica:
MM/AA— até 4 dígitos:'12/24'MM/AAAA— a partir do 5° dígito:'12/2024'
Uso:
TextField(
keyboardType: TextInputType.number,
inputFormatters: [CardExpiryMask()],
)
Exemplos de transformação:
'1224'→'12/24'(MM/AA)'122024'→'12/2024'(MM/AAAA)
- Inheritance
-
- Object
- TextInputFormatter
- BrInputMask
- CardExpiryMask
Constructors
- CardExpiryMask()
-
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
formatEditUpdate(
TextEditingValue oldValue, TextEditingValue newValue) → TextEditingValue -
Called when text is being typed or cut/copy/pasted in the EditableText.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited