PhoneFormatSpec class
Defines the national-number format for a specific country.
Pattern syntax:
# → consumes one digit
→ space separator (displayed while typing)
- → dash separator
(/) → parenthesis (used in NANP format)
Example: ## ####-###### for Bangladesh → 17 5869-130323
Constructors
- PhoneFormatSpec({required String pattern, required String example, required int minLength, required int maxLength})
-
const
- PhoneFormatSpec.generic({String example = '1234567890'})
-
Fallback spec used when no country-specific override exists.
Accepts up to 15 digits (E.164 max) with simple grouping.
factory
Properties
- example → String
-
A localised example number string shown as hint (e.g.
17 5869-130323).final - hashCode → int
-
The hash code for this object.
no setterinherited
- maxLength → int
-
Maximum digit count for a national number.
final
- minLength → int
-
Minimum digit count for a valid national number.
final
- pattern → String
-
The display pattern used while typing (e.g.
## #### ######).final - 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