isChinese static method

bool isChinese(
  1. String s
)

字符串是否是中文

Implementation

static bool isChinese(String s) {
  if (s.length > 16 || s.length < 9) return false;
  return hasMatch(s, r'^[\u4e00-\u9fa5]+$');
}