isNullOrBlank method

bool isNullOrBlank(
  1. dynamic value

Checks if data is null or blank (empty or only contains whitespace).


static bool isNullOrBlank(dynamic value) {
  if (isNull(value)) {
    return true;

  if (value is String) {
    return value.toString().trim().isEmpty;

  // Pretty sure that isNullOrBlank should't be validating
  // iterables... but I'm going to keep this for compatibility.
  return _hasIsEmpty(value) ? value.isEmpty as bool : false;