getUserById method

UserModel? getUserById(
  1. String userId
)

Implementation

UserModel? getUserById(String userId) {
  int index = getUserIndex(userId, userInfoList);
  if (index == -1) {
    return null;
  }
  return userInfoList[index];
}