isChinese property

bool isChinese

Verifies that the string is composed entirely of Chinese characters. It can be used for validating input meant to be in Chinese without any foreign characters.

Example:

print('你好'.isChinese); // Output: true
print('Hello你好'.isChinese); // Output: false

Implementation

bool get isChinese => RegExp(r'^[\u4e00-\u9fa5]+$').hasMatch(this);