creditCard static method

TextInputFormatter creditCard()

use to format creditCard fields

TextFormField(
  autovalidateMode: AutovalidateMode.onUserInteraction,
  inputFormatters: [Mask.creditCard()],
),

Implementation

static TextInputFormatter creditCard() {
  return GenericMask(mask: ['##### ##### ##### #####']);
}