checkUserIdList static method

bool checkUserIdList(
  1. List<int> userIdList, {
  2. bool showToast = true,
})

Implementation

static bool checkUserIdList(List<int> userIdList,{bool showToast=true}) {
  List<int> toRemove=[];
  for(int i=0;i<userIdList.length;i++){
      int userId=userIdList[i];
      dynamic user=pocChangeNotifier.getUser(userId);
      Log.i(tag, "checkUserIdList:userId:$userId");
      Log.i(tag, "checkUserIdList:user:$user");
      if(user==null){
        toRemove.add(userId);
      }
  }

  for (int userId in toRemove) {
    userIdList.remove(userId);
  }

  if(userIdList.isNotEmpty){
    return true;
  }else{
    if(showToast){
      playText(getTranslation("NoMatchingUsers"), true);
      ToastUtils.instance.show(getTranslation("NoMatchingUsers"));
    }
    return false;
  }
}