BankInputMask class sealed

Describes how a BankMaskedInputField filters, formats, and validates what the user types.

Built-in masks:

  • BankInputMask.iban: uppercase alphanumerics in groups of four, capped at 34 characters, validated with the ISO 13616 mod-97 checksum.
  • BankInputMask.cardPan: digits in groups of four, capped at 19, validated with the Luhn checksum; can obscure all but the last four digits.
  • BankInputMask.sortCode: six-digit UK sort code shown as NN-NN-NN.
  • BankInputMask.custom: arbitrary digit patterns such as '## ### ###'.

The checksum routines are also available directly via the static isValidIban and isValidLuhn hooks for use in form-level validation.

Constructors

BankInputMask.cardPan({bool obscureAllButLast4})
Payment-card primary account number mask.
const
factory
BankInputMask.custom(String pattern, {String digitChar})
Custom digit mask driven by pattern.
const
factory
BankInputMask.iban()
International Bank Account Number mask.
const
factory
BankInputMask.sortCode()
UK sort code mask rendered as NN-NN-NN.
const
factory

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

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
validate(String raw) bool
Returns true when the raw (unmasked) raw value passes this mask's validation: mod-97 for IBAN, Luhn for card PAN, and completeness for sort codes and custom patterns.

Operators

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

Static Methods

isValidIban(String input) bool
Returns true when input is a structurally valid IBAN with a correct ISO 13616 mod-97 checksum. Spaces are ignored and letters are case-insensitive.
isValidLuhn(String input) bool
Returns true when the digits in input pass the Luhn checksum and form a plausible card number (12–19 digits). Non-digits are ignored.