formatIBANInput function

String formatIBANInput(
  1. String value
)

Formats an IBAN as the user types: uppercase, in groups of four (PK36 SCBL 0000 0011 2345 6702), up to 24 characters.

Implementation

String formatIBANInput(String value) {
  final clean =
      _take(jsToUpperCase(value).replaceAll(_nonAlphanumeric, ''), 24);
  return clean.replaceAllMapped(_groupOfFour, (match) => '${match[1]} ');
}