ValidifyDart class
A utility class that provides various methods for validation such as phone numbers, email, URLs, financial data, and more.
Constructors
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
-
containsNumeric(
String value) → bool - Checks if the string contains numeric digits.
-
containsOnlyWhitespace(
String value) → bool - Checks if the string contains only whitespace.
-
hasMaxLength(
String value, int maxLength) → bool - Checks if the string has a maximum length.
-
hasMinLength(
String value, int minLength) → bool - Checks if the string has a minimum length.
-
hasValidSubdomain(
String url) → bool - Validates if a URL contains a valid subdomain. The URL must contain subdomains and a valid domain extension.
-
isAlphabetic(
String value) → bool - Validates if the value contains only alphabetic characters.
-
isAlphanumeric(
String value) → bool - Validates if the value contains only alphanumeric characters.
-
isConnectedToInternet(
) → Future< bool> - Checks if the device is connected to the internet. Returns true if connected to any network (WiFi or mobile data).
-
isConnectedToWiFi(
) → Future< bool> - Checks if the device is connected to WiFi. Returns true if connected to a WiFi network.
-
isDivisibleBy(
int number, int divisor) → bool - Checks if the number is divisible by the given divisor.
-
isEven(
int number) → bool - Checks if the number is even.
-
isFibonacci(
int number) → bool - Checks if the number is a Fibonacci number.
-
isInRange(
num value, num min, num max) → bool - Checks if the value is within the specified range.
-
isLeapYear(
int year) → bool - Checks if the year is a leap year.
-
isLowerCase(
String value) → bool - Checks if the string is in lowercase.
-
isNegative(
num value) → bool - Checks if the number is negative.
-
isOdd(
int number) → bool - Checks if the number is odd.
-
isPalindrome(
String value) → bool - Checks if the value is a palindrome.
-
isPositive(
num value) → bool - Checks if the number is positive.
-
isPrime(
int number) → bool - Checks if the number is prime. A prime number is greater than 1 and has no divisors other than 1 and itself.
-
isSquareNumber(
int number) → bool - Checks if the number is a perfect square.
-
isStrongPassword(
String password) → bool - Validates password strength Requirements: 8+ chars, 1 uppercase, 1 lowercase, 1 number, 1 special char
-
isUpperCase(
String value) → bool - Checks if the string is in uppercase.
-
isValidAadhaar(
String aadhaar) → bool - Validates an Aadhaar number (India's national identity number). The Aadhaar number must be a 12-digit numeric value.
-
isValidBinary(
String value) → bool - Validates if the value is a binary number (only 0 and 1).
-
isValidBitcoinAddress(
String address) → bool - Validates a Bitcoin address (Base58Check format)
-
isValidCreditCard(
String number) → bool - Validates a credit card number using the Luhn algorithm. Returns true if the credit card number is valid.
-
isValidCurrencyCode(
String code) → bool - Validates a 3-letter currency code (e.g., USD, EUR).
-
isValidCUSIP(
String cusip) → bool - Validates a CUSIP (Committee on Uniform Securities Identification Procedures).
-
isValidDateFormat(
String date) → bool - Validates the date format (YYYY-MM-DD).
-
isValidDrivingLicense(
String license) → bool - Validates a driving license number. The format is two uppercase letters followed by 13 digits.
-
isValidEIN(
String ein) → bool - Validates an Employer Identification Number (EIN). The format is two digits, a hyphen, and seven digits (e.g., 12-3456789).
-
isValidEmail(
String email) → bool - Validates an email address. The email format includes alphanumeric characters, followed by an @ symbol, and a valid domain.
-
isValidEthereumAddress(
String address) → bool - Validates an Ethereum address Format: 40 hexadecimal characters prefixed with 0x
-
isValidFileExtension(
String filename, List< String> validExtensions) → bool - Validates a file extension
-
isValidGSTIN(
String gstin) → bool - Validates a GSTIN (Goods and Services Tax Identification Number). GSTIN format: 15 alphanumeric characters in a specific pattern.
-
isValidHexColor(
String color) → bool - Validates a hex color code (e.g., #FFFFFF, #000).
-
isValidIBAN(
String iban) → bool - Validates an International Bank Account Number (IBAN). IBAN can range from 15 to 34 alphanumeric characters.
-
isValidIFSC(
String ifsc) → bool - Validates an IFSC (Indian Financial System Code). IFSC format: Four uppercase letters followed by zero and six alphanumeric characters.
-
isValidIPv4(
String ip) → bool - Validates an IPv4 address Format: Four octets separated by dots (e.g., 192.168.1.1)
-
isValidIPv6(
String ip) → bool - Validates an IPv6 address. The format follows the IPv6 standard for address representation.
-
isValidISBN13(
String isbn) → bool - Validates an ISBN-13 number
-
isValidISIN(
String isin) → bool - Validates an ISIN (International Securities Identification Number). ISIN format: Two letters, followed by nine alphanumeric characters, and a single digit.
-
isValidJSON(
String json) → bool - Validates if the string is a valid JSON.
-
isValidLatitude(
double lat) → bool - Validates latitude value Range: -90 to 90 degrees
-
isValidLongitude(
double lon) → bool - Validates longitude value Range: -180 to 180 degrees
-
isValidMACAddress(
String mac) → bool - Validates a MAC (Media Access Control) address.
-
isValidMarkdown(
String markdown) → bool - Validates Markdown syntax for headers, bold, and italic text.
-
isValidMIC(
String mic) → bool - Validates an MIC (Market Identifier Code).
-
isValidPAN(
String pan) → bool - Validates a PAN (Permanent Account Number) card. PAN format is 5 letters, 4 digits, and 1 letter (e.g., ABCDE1234F).
-
isValidPassport(
String passport) → bool - Validates a passport number. The passport number starts with one letter followed by seven digits.
-
isValidPhone(
String? phone) → bool - Validates an international phone number. The phone number can start with a plus sign followed by country code and digits. Example: "+14155552671".
-
isValidPort(
int port) → bool - Validates a port number Range: 0-65535
-
isValidSemVer(
String version) → bool - Validates a semantic version number Format: MAJOR.MINOR.PATCH (e.g., 1.2.3)
-
isValidSIN(
String sin) → bool -
isValidSSN(
String ssn) → bool - Validates a Social Security Number (SSN). The SSN format is three digits, two digits, and four digits (e.g., 123-45-6789).
-
isValidTimeFormat(
String time) → bool - Validates the time format (HH:MM:SS).
-
isValidUPIID(
String upiId) → bool - Validates a UPI ID (Unified Payments Interface ID).
-
isValidUrl(
String url) → bool - Validates a URL. The URL must start with http or https followed by a valid domain.
-
isValidUSZipCode(
String zip) → bool - Validates a ZIP code (US format) Format: 5 digits or 5+4 digits with hyphen (e.g., 12345 or 12345-6789)
-
isValidUUID(
String uuid) → bool - Validates a UUID (Universally Unique Identifier).
-
isValidVIN(
String vin) → bool - Validates a VIN (Vehicle Identification Number) Format: 17 alphanumeric characters Validates a VIN (Vehicle Identification Number). Format: 17 alphanumeric characters with a valid check digit (9th position).
-
isValidVoterID(
String voterId) → bool - Validates a voter ID. The format is three uppercase letters followed by seven digits (e.g., ABC1234567).