isPhone property

bool get isPhone

Returns true if string matches IPv6 format.

final str1 = "fffe:3465:efab:23fe:2235:6565:aaab:0001";
final str2 = "xyz";
str1.isIPv6;  // true
str2.isIPv6;  // false

Implementation

bool get isPhone => RegExp(
        r"^(0|\+|(\+[0-9]{2,4}|\(\+?[0-9]{2,4}\)) ?)([0-9]*|\d{2,4}-\d{2,4}(-\d{2,4})?)$",
        caseSensitive: false)
    .hasMatch(this);