isBlank property

bool get isBlank

Whether this string is empty or consists solely of whitespace characters.

''.isBlank;          // true
'   '.isBlank;       // true
'\n\t'.isBlank;      // true
'hello'.isBlank;     // false

Implementation

bool get isBlank => trim().isEmpty;