defaultEmptyChecker static method

bool defaultEmptyChecker(
  1. dynamic content
)

Default empty checker. It supports Emptyable List, Map, Iterable, String, by calling isEmpty on it. Otherwise, UnsupportedError is thrown.

Implementation

static bool defaultEmptyChecker(dynamic content) {
  if (content is Emptyable) {
    return content.isEmpty;
  }

  if (content is List) {
    return content.isEmpty;
  }

  if (content is Map) {
    return content.isEmpty;
  }

  if (content is Iterable) {
    return content.isEmpty;
  }

  if (content is String) {
    return content.isEmpty;
  }

  return false;
}