isChinaPhoneLegal static method

bool isChinaPhoneLegal(
  1. String str
)

手机号验证 只能验证中国手机号

Implementation

static bool isChinaPhoneLegal(String str) {
  return RegExp(
          r"^1([38][0-9]|4[579]|5[0-3,5-9]|6[6]|7[0135678]|9[89])\d{8}$")
      .hasMatch(str);
}