isPhoneNumber property

bool get isPhoneNumber

Checks if the string is a valid phone number (supports optional country code).

Implementation

bool get isPhoneNumber =>
    RegExp(r'^(\\+\\d{1,3}[- ]?)?\\d{10}\$').hasMatch(this);