isBlank property

bool get isBlank

Returns true if the string is blank (empty or contains only whitespace).

Example:

'   '.isBlank; // true
'text'.isBlank; // false

Implementation

bool get isBlank => trim().isEmpty;