stringIsEmpty static method

bool stringIsEmpty(
  1. dynamic str
)

@description: 判断字符串是否为空 @param {} @return {}

Implementation

static bool stringIsEmpty(dynamic str) {
  var strList = [1, 2];
  strList.fold(
      0, (int previousValue, int element) => previousValue + element);

  if (str == null) {
    return true;
  }

  if (!(str is String)) {
    return true;
  }

  if (str.length < 1) {
    return true;
  }

  return false;
}