getAllSubs function

Future<List<List<Page>>> getAllSubs(
  1. String username,
  2. String password, {
  3. ScHttpClient? http,
  4. String endpoint = dsb.Session.defaultEndpoint,
  5. String previewEndpoint = dsb.Session.defaultPreviewEndpoint,
  6. bool downloadPreviews = false,
  7. ParserBuilder parser = untis.Substitution.fromUntis,
})

Implementation

Future<List<List<Page>>> getAllSubs(
  String username,
  String password, {
  ScHttpClient? http,
  String endpoint = dsb.Session.defaultEndpoint,
  String previewEndpoint = dsb.Session.defaultPreviewEndpoint,
  bool downloadPreviews = false,
  untis.ParserBuilder parser = untis.Substitution.fromUntis,
}) =>
    dsb.Session.login(username, password,
            endpoint: endpoint, previewEndpoint: previewEndpoint, http: http)
        .then((s) => s.getTimetables().then(
              (t) => s
                  .downloadAndParsePlans(t,
                      downloadPreviews: downloadPreviews, parser: parser)
                  .then((x) => x.toNestedList()),
            ));