ValidationPattern enum

Represents standard HTML input validation regex patterns.

Inheritance
Available extensions

Values

digitsOnly → const ValidationPattern

Digits / numbers only (0-9). Example: '12345'

const ValidationPattern('[0-9]*')
signedIntegers → const ValidationPattern

Optional negative sign followed by digits only. Example: '-42' or '100'

const ValidationPattern(r'^-?[0-9]*$')
signedIntegersAllowLeadingPlus → const ValidationPattern

Optional leading plus or minus sign followed by digits. Example: '+42' or '-10'

const ValidationPattern(r'^[+-]?[0-9]*$')
positiveDecimals → const ValidationPattern

Positive decimal numbers with optional leading zero. Example: '3.14' or '0.5'

const ValidationPattern(r'^(0|[1-9]\d*)(\.\d+)?$')
signedDecimals → const ValidationPattern

Signed decimal numbers (positive or negative) with optional leading plus or minus sign and optional decimal part. Example: '-12.34' or '+0.99'

const ValidationPattern(r'^[+-]?(\d+(\.\d*)?|\.\d+)$')
nonNegative → const ValidationPattern

Non-negative numbers with optional decimal part. Example: '0' or '25.50'

const ValidationPattern(r'^\d+(\.\d+)?$')
negative → const ValidationPattern

Negative numbers with optional decimal part. Example: '-5' or '-19.99'

const ValidationPattern(r'^-\d+(\.\d+)?$')
positiveIntegers → const ValidationPattern

Positive integers (numbers without decimal part). Example: '1' or '42'

const ValidationPattern(r'^[1-9]\d*$')
negativeIntegers → const ValidationPattern

Negative integers (numbers without decimal part). Example: '-1' or '-100'

const ValidationPattern(r'^-\d+$')
lettersOnly → const ValidationPattern

Letters only (a-z, A-Z). Example: 'John' or 'hello'

const ValidationPattern('[a-zA-Z]*')
alphanumeric → const ValidationPattern

Letters and digits only. Example: 'Code123'

const ValidationPattern('[a-zA-Z0-9]*')
alphanumericWithSpaces → const ValidationPattern

Letters, digits, and spaces. Example: 'John Doe 123'

const ValidationPattern('[a-zA-Z0-9 ]*')
decimal → const ValidationPattern

Integer or decimal numbers. Example: '10.5' or '42'

const ValidationPattern(r'[0-9]*\.?[0-9]*')
email → const ValidationPattern

Standard email address format. Example: 'user@example.com'

const ValidationPattern(r'[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}')
url → const ValidationPattern

Web URL starting with http:// or https://. Example: 'https://example.com'

const ValidationPattern(r'https?://.+')
phone → const ValidationPattern

Telephone number digits and symbols (+, -, ()). Example: '+1 (555) 000-1234'

const ValidationPattern(r'^\+?[0-9\s\-()]{7,15}$')
noSpaces → const ValidationPattern

Disallows space characters. Example: 'no_spaces_here'

const ValidationPattern(r'^\S+$')
hexColor → const ValidationPattern

Hexadecimal color code. Example: '#FFF' or '#1A2B3C'

const ValidationPattern(r'#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})')
zipCode → const ValidationPattern

Postal / ZIP code format (US). Example: '90210' or '12345-6789'

const ValidationPattern(r'[0-9]{5}(-[0-9]{4})?')
username → const ValidationPattern

Username format (3-30 alphanumeric chars, dots, hyphens, or underscores). Example: 'john_doe'

const ValidationPattern(r'[a-zA-Z0-9_.-]{3,30}')

Properties

hashCode → int
The hash code for this object.
no setterinherited
index → int
A numeric identifier for the enumerated value.
no setterinherited
name → String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
value → String
The standard CSS value representing the input validation pattern.
final

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

Constants

values → const List<ValidationPattern>
A constant List of the values in this enum, in order of their declaration.