bakalari 0.1.0 copy "bakalari: ^0.1.0" to clipboard
bakalari: ^0.1.0 copied to clipboard

outdated

Package that allows reading data from Czech school system Bakaláři. This unofficial library grants access to data that may be locked in the official app - for example all grades weights.

example/main.dart

import 'package:bakalari/bakalari.dart';
import 'dart:io';

main(List<String> args) {
  print('Dart example of \'bakalari\' library has loaded.');
  print('Enter your school Uri (*has* to end with /login.aspx/! Library doesn\'t fix wrong format.)');
  var uri = stdin.readLineSync();
  print('Enter username');
  var username = stdin.readLineSync();
  print('Enter password');
  var password = stdin.readLineSync();
  someAsyncFunction(username, password, uri);
}

/// The code accessing bakaweb should be in special async function.
void someAsyncFunction(String username, String password, String uri) async{
  var bkw = Bakalari(Uri.parse(uri));
  await bkw.logIn(username, password);

  print('Welcome, student ${bkw.student.name}, class ${bkw.student.schoolClass} (year: ${bkw.student.year})! '
  'This library has successfully connected to ${bkw.school.name} (${bkw.school.bakawebVersion}). '
  'You can visit the official Bakaweb service by clicking on this link: ${bkw.school.bakawebLink}');

  var grades = await bkw.getGrades();
  for (var grade in grades) {
    print(grade);
  }
  var timetable = await bkw.getTimetable();
  print('Timetable is done!');
  print('Use debug mode to inspect it, I didn\'t write toString method because of it\'s complexity.');

  var pms = await bkw.getMessages();
  print('Messages:');
  for (var message in pms) {
    print(message);
  }
}
0
likes
0
pub points
0%
popularity

Publisher

unverified uploader

Package that allows reading data from Czech school system Bakaláři. This unofficial library grants access to data that may be locked in the official app - for example all grades weights.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

http, intl, pointycastle, xml

More

Packages that depend on bakalari