Pure functions that validate and normalize Turkish identifiers.
Every function accepts user input as typed: surrounding whitespace and, where it makes sense, spaces, dashes, dots and parentheses are ignored.
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
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
formatIban(
String? value) → String? -
Formats a Turkish IBAN in groups of four characters
(
TR33 0006 1005 1978 6457 8413 26), or returnsnullifvalueis not a valid Turkish IBAN. -
formatPhone(
String? value, {bool international = false}) → String? -
The phone number for display:
0532 123 45 67, or+90 532 123 45 67wheninternationalis true. Returnsnullifvalueis not a valid Turkish phone number. -
ibanBankCode(
String? value) → String? -
The 5-digit bank code of a valid Turkish IBAN (for example
'00061'), ornullifvalueis not valid. -
isValidIban(
String? value) → bool -
Whether
valueis a valid Turkish IBAN. -
isValidLandlinePhone(
String? value) → bool -
Whether
valueis a valid Turkish geographic landline number. -
isValidMobilePhone(
String? value) → bool -
Whether
valueis a valid Turkish mobile (GSM) number. -
isValidPhone(
String? value) → bool -
Whether
valueis a valid Turkish phone number (mobile, landline or non-geographic). See nationalPhoneNumber for accepted spellings. -
isValidTaxNumber(
String? value) → bool -
Whether
valueis a valid tax number: a 10-digit VKN (isValidVergiKimlik) or an 11-digit T.C. kimlik numarası (isValidTcKimlik), as accepted on Turkish e-invoices. -
isValidTcKimlik(
String? value) → bool -
Whether
valueis a valid T.C. kimlik numarası (Turkish national ID). -
isValidVergiKimlik(
String? value) → bool -
Whether
valueis a valid vergi kimlik numarası (VKN, 10-digit tax number of companies and other legal entities), using the check-digit algorithm of the Turkish Revenue Administration (GİB). -
nationalPhoneNumber(
String? value) → String? -
The 10-digit national phone number (without the leading 0 or +90), or
nullifvalueis not a valid Turkish phone number. -
normalizeIban(
String value) → String -
Removes whitespace and dashes and upper-cases
value, for example'tr33 0006-1005'becomes'TR3300061005'. -
normalizePhone(
String? value) → String? -
The phone number in E.164 form (
+905321234567), ornullifvalueis not a valid Turkish phone number. Use this form for storage and APIs. -
phoneType(
String? value) → TurkishPhoneType? -
The TurkishPhoneType of
value, ornullif it is not a valid Turkish phone number.