checkEmpty static method

bool checkEmpty(
  1. List<String?>? str,
  2. List<String> msg, {
  3. dynamic fun(
    1. int
    )?,
})

Implementation

static bool checkEmpty(List<String?>? str, List<String> msg,
    {Function(int)? fun}) {
  bool flag = true;
  if (str != null) {
    for (int i = 0; i < str.length; i++) {
      String? item = str[i];
      if (item == null || item.trim().isEmpty) {
        flag = false;
        if (i < msg.length) {
          // showToast(msg[i]);
        }
        if (fun != null) {
          fun(i);
        }
        break;
      }
    }
  }

  return flag;
}