PDPhoneValidator class

手机号相关的格式化与校验工具。

目前提供中国大陆手机号的基础校验、格式化、脱敏能力。

Constructors

PDPhoneValidator()

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

formatCNPhone(String phone) String
格式化中国大陆手机号为 xxx xxxx xxxx
maskCNPhone(String phone) String
脱敏中国大陆手机号,格式为 xxx****xxxx
validateCNPhone(String? phone) String?
校验中国大陆手机号。