string_validator_plus library

This file exports various validation modules and extensions. Developers can import this file to access the validation functions and extensions.

Enums

CreditCardType
Identify Type of Credit Card

Extensions

IntCreditCardTypeExtension on int
IntDivisorsExtension on int
Extension for generating a list of divisors of an integer.
IntFactorialExtension on int
Extension for calculating the factorial of an integer.
IntGCDExtension on int
Extension for calculating the Greatest Common Divisor (GCD) of integers.
IntIsCreditCardNumberExtension on int
Check if an Integer is a Valid Credit Card Number
IntIsCVVNumberExtension on int
Check if an Integer is a Valid CVV Number
IntIsEvenOrOddExtension on int
Extension for checking if an integer is even or odd.
IntIsPalindromeExtension on int
Extension for checking if an integer is a palindrome.
IntIsPerfectSquareExtension on int
Extension for checking if an integer is a perfect square.
IntIsPowerOfTwoExtension on int
Extension for checking if an integer is a power of two.
IntIsPrimeExtension on int
Extension for checking if an integer is prime.
IntLCMExtension on int
Extension for calculating the Least Common Multiple (LCM) of integers.
IntNumberOfDigitsExtension on int
Extension for calculating the number of digits in an integer.
IntSumOfDigitsExtension on int
Extension for calculating the sum of digits in an integer.
IntToBinaryExtension on int
Extension for converting an integer to its binary representation.
IntToHexadecimalExtension on int
Extension for converting an integer to its hexadecimal representation.
IntToOctalExtension on int
Extension for converting an integer to its octal representation.
ListIsEmptyExtension on List<T>
Extension for checking if a list is empty.
ListRemoveDuplicatesExtension on List<T>
Extension for removing duplicates from a list.
ListShuffleExtension on List<T>
Extension for shuffling the elements of a list.
RandomStringGenerator on String
Random String Generator
StringCapitalizeExtension on String
Capitalize First Letter
StringCountOccurrencesExtension on String
Count Occurrences of a Substring
StringExtensions on String
Mask Sensitive Information
StringIsDigitsExtension on String
Check if a String Contains Only Digits
StringIsLettersExtension on String
Check if a String Contains Only Letters
StringIsPalindromeExtension on String
Check if a String is Palindrome
StringReplaceAllExtension on String
Replace All Occurrences
StringReverseExtension on String
Reverse a String
StringTitleCaseExtension on String
Convert to Title Case
StringTrimExtension on String
Trim Leading and Trailing Whitespace

Functions

contains(String str, String substring) bool
Function to check if the given string contains the specified substring.
detectCreditCardType(String? creditCardNumber) String?
Detects the type of a credit card based on its number.
equals(String str, Object? comparison) bool
Function to check if the given string is equal to the provided comparison object.
isAlpha(String str) bool
Function to check if the given string contains only alphabetic characters (letters).
isAlphanumeric(String str) bool
Function to check if the given string contains only alphanumeric characters.
isAscii(String str) bool
Function to check if the given string contains only ASCII characters.
isBase64(String str) bool
Function to check if the given string is a valid Base64-encoded string.
isDivisibleBy(String str, int number) bool
Function to check if the given string is divisible by the specified number.
isFloat(String str) bool
Function to check if the given string represents a floating-point number.
isFQDN(String str) bool
Function to check if the given string is a Fully Qualified Domain Name (FQDN).
isGSTNumberValid(String gstNumber) bool
Function to check if the given GST number is valid.
isHexadecimal(String str) bool
Function to check if the given string contains only hexadecimal characters (0-9, A-F, a-f).
isHexColor(String str) bool
Function to check if the given string is a valid hexadecimal color representation.
isInt(String str) bool
Function to check if the given string represents an integer number.
isIP(String str, {int? version}) bool
Function to check if the given string is a valid IP address (IPv4 or IPv6).
isJson(String str) bool
Function to check if the given string is a valid JSON string.
isLowercase(String str) bool
Function to check if the given string contains only lowercase alphabetic characters.
isNumeric(String str) bool
Function to check if the given string contains only numeric characters.
isUppercase(String str) bool
Function to check if the given string contains only uppercase alphabetic characters.
isURL(String? str, {List<String?> protocols = const ['http', 'https', 'ftp'], bool requireTld = true, bool requireProtocol = false, bool allowUnderscore = false, List<String> hostWhitelist = const [], List<String> hostBlacklist = const []}) bool
Function to check if the given string is a valid URL.
isUUID(String? str, [dynamic version]) bool
Function to check if the given string is a valid UUID (Universally Unique Identifier).
isValidateCreditCard(String cardNumber) bool
Function to check if the given string is a valid credit card number.
isValidateCreditCardCVV(String cvv) bool
Function to check if the given string is a valid credit card CVV (Card Verification Value).
isValidateCreditCardExpiry(String expiryDate) bool
Function to check if the given string is a valid credit card expiry date.
isValidateDateFormat(String date, {String format = 'yyyy-MM-dd'}) bool
Function to check if the given string is a valid date in the specified format.
isValidateEmail(String email) bool
Function to check if the given email is in a valid format.
isValidateHexColor(String colorCode) bool
Function to check if the given string is a valid hexadecimal color code.
isValidateIndianPhoneNumber(String? phoneNumber) bool
Function to check if the given phone number is a valid Indian mobile number.
isValidateIPAddress(String ipAddress) bool
Function to check if the given string is a valid IP address (IPv4).
isValidateNumeric(String input) bool
Function to check if the given string is a valid numeric value (integer or decimal).
isValidatePassword(String password) bool
Function to check if the given password is in a valid format.
isValidatePhoneNumber(String phoneNumber) bool
Function to check if the given phone number is in a valid format.
isValidatePositiveNumber(String number) bool
Function to check if the given number is a positive number (including decimals).
isValidateUsername(String username) bool
Function to check if the given string is a valid username.
isValidateUSPostalCode(String postalCode) bool
Function to check if the given string is a valid US postal code.
isValidIMEI(String value) bool
Function to check if the given value is a valid International Mobile Equipment Identity (IMEI) number.
isValidMACAddress(String value) bool
Function to check if the given value is a valid Media Access Control (MAC) address.
isValidMimeType(String value) bool
Function to check if the given value is a valid Multipurpose Internet Mail Extensions (MIME) type.
maskSensitiveInformation(String input, {int visibleChars = 4}) String
Masks sensitive information in a string by replacing most characters with asterisks, leaving only the last visibleChars characters unmasked.
matches(String str, String pattern) bool
Function to check if the given string matches the specified pattern using regular expressions.
validateAadhaarCard(String? value) String?
Validates an Aadhaar card number.
validateAustralianDriverLicense(String? value) String?
Validates an Australian driver's license number.
validateAustralianMobile(String? value) String?
Validates an Australian mobile number.
validateAustralianTFN(String? value) String?
Validates a Tax File Number (TFN) for Australia.
validateBangladeshiNID(String? value) String?
Validates a National Identification Number (NID) for Bangladesh.
validateBrazilianMobile(String? value) String?
Validates a Brazilian mobile number.
validateCanadianDriverLicense(String? value) String?
Validates a Canadian driver's license number.
validateCanadianMobile(String? value) String?
Validates a Canadian mobile number.
validateCanadianPostalCode(String? value) String?
Validates a Canadian postal code.
validateCanadianSIN(String? value) String?
Validates a Social Insurance Number (SIN) for Canada.
validateConfirmPassword(String? password, String? confirmPassword) String?
Validates that a password matches a confirm password.
validateDriversLicense(String? value) String?
Validates a generic driver's license number.
validateEmail(String? value) String?
Validates the format of an email address.
validateFrenchMobile(String? value) String?
Validates a French mobile number.
validateGermanMobile(String? value) String?
Validates a German mobile number.
validateGSTNumber(String? value) String?
Validates a GST (Goods and Services Tax) number.
validateIMEI(String? value) String?
Validate IMEI (International Mobile Equipment Identity) number.
validateIndianDriverLicense(String? value) String?
Validates an Indian driver's license number.
validateIndianMobile(String? value) String?
Validates an Indian mobile number.
validateIndianPostalCode(String? value) String?
Validates an Indian postal code.
validateInput(String? value) String?
Validates that a required input is not null or empty.
validateISBN(String? value) String?
Validate ISBN (International Standard Book Number).
validateLatitudeLongitude(String? latitude, String? longitude) String?
Validate latitude and longitude coordinates.
validateMACAddress(String? value) String?
Validate MAC (Media Access Control) address.
validateMalaysianIC(String? value) String?
Validates an Identity Card Number (IC) for Malaysia.
validateMimeType(String? value) String?
Validate MIME (Multipurpose Internet Mail Extensions) type.
validateNigerianNIN(String? value) String?
Validates a National Identification Number (NIN) for Nigeria.
validatePANCard(String? value) String?
Validates a PAN (Permanent Account Number) card number.
validatePassportNumber(String? value) String?
Validates a passport number.
validatePassword(String? password) String?
Validates the strength of a password.
validateSouthAfricanPIN(String? value) String?
Validates a Personal Identification Number (PIN) for South Africa.
validateSpanishNSSN(String? value) String?
Validates a Spanish Social Security Number (NSSN) for Spain.
validateSSN(String? value) String?
Validates a Social Security Number (SSN) for the United States.
validateSwedishPN(String? value) String?
Validates a Swedish Personal Number (PN).
validateUKDriverLicense(String? value) String?
Validates a UK driver's license number.
validateUKMobile(String? value) String?
Validates a UK mobile number.
validateUKNIN(String? value) String?
Validates a National Insurance Number (NIN) for the United Kingdom.
validateUSDriverLicense(String? value) String?
Validates a US driver's license number.
validateUSMobile(String? value) String?
Validates a US mobile number.
validateUSZipCode(String? value) String?
Validates a United States ZIP code.