PhoneFormatter class abstract final

Phone parsing and normalization via flutter_libphonenumber.

Call tryParse or tryFullNumber as static methods, same style as TextFormatter / NumberFormatter.

Pass country or region (ISO code such as US, IL) when the input is a national number without a leading +. For numbers that already start with +, region is optional.

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

tryFullNumber(String phone, {FxCountry? country, String? region}) Future<String?>
Returns PhoneParseResult.fullNumber for phone, or null if parsing fails.
tryParse(String phone, {FxCountry? country, String? region}) Future<PhoneParseResult?>
Parses phone and returns structured fields, or null if invalid.