lyon1agendaclient 1.0.9 copy "lyon1agendaclient: ^1.0.9" to clipboard
lyon1agendaclient: ^1.0.9 copied to clipboard

A Dart library for retrieving Lyon 1 University agendas using Lyon1CasClient for authentication.

example/example.dart

import 'package:lyon1agendaclient/lyon1agendaclient.dart';
import 'package:lyon1casclient/lyon1casclient.dart';

void main() async {
  final Lyon1AgendaClient agendaClient =
      Lyon1AgendaClient.useLyon1Cas(Lyon1CasClient());
  final Agenda? agendaOpt = await agendaClient.getAgenda(ids: [10069]);
  //or for automatic ids fetching:
  final Agenda? agendaOpt2 =
      await agendaClient.getAgenda(ids: await agendaClient.getAgendaIds);

  if (agendaOpt == null) {
    // handle gracefully
  }
  final Agenda agenda = agendaOpt ?? agendaOpt2 ?? Agenda.empty();

  for (final Day day in agenda.days) {
    print(day.date.toString());
    for (final Event e in day.events) {
      print(e.name);
      print("\t${e.location} | ${e.teacher}");
      print("\t${e.start.toString()} -> ${e.end.toString()}");
    }
  }
}
0
likes
125
pub points
21%
popularity

Publisher

unverified uploader

A Dart library for retrieving Lyon 1 University agendas using Lyon1CasClient for authentication.

Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (LICENSE)

Dependencies

copy_with_extension, dotenv, equatable, hive, icalendar_parser, lyon1casclient, requests_plus

More

Packages that depend on lyon1agendaclient