isNullOrWhiteSpace property

bool isNullOrWhiteSpace

Indicates whether a specified string is null, empty, or consists only of white-space characters.

Implementation

bool get isNullOrWhiteSpace {
  var length = (this?.split('') ?? []).where((x) => x == ' ').length;
  return length == (this?.length ?? 0) || this.isEmptyOrNull;
}