checkLoggedIn method

Student? checkLoggedIn(
  1. BeautifulSoup soup,
  2. int gymId
)

Implementation

Student? checkLoggedIn(BeautifulSoup soup, int gymId) {
  var metaElement = soup
      .find('*', attrs: {'name': appStartUrlName})?.getAttrValue('content');
  if (metaElement != null) {
    var queries = queriesFromSoup(metaElement);
    if (queries.containsKey(elevIdKey)) {
      return Student(queries[elevIdKey]!, gymId);
    }
    if (queries.containsKey(laererIdKey)) {
      return Student(queries[laererIdKey]!, gymId, teacher: true);
    }
  }
  return null;
}