An unofficial wrapper for the kdecole api

Related tags

Templates dart kdecole
Overview

This is an UNOFFICIAL wrapper for the kdecole api

How to use ?

Login

First, you need to create a Client() object :

LOGIN AND PASSWORD ARE NOT YOUR ENT ONES. TEMPORARY USERNAME AND PASSWORD GIVEN TO INIT THE MOBILE APP SHALL BE USED

var client = Client(Urls.<your CAS>, 'your username', 'your password');

or if you already have a token :

var client = Client.fromToken('tokennnnnn', Urls.<your CAS>);

Now you're logged !!

To unlog :

await client.unlog();

Messaging

Get the mail box

Of course, you need to have a Client() object,
Next, just get an email list :

var list = await client.getEmails();

It returns you a list of emails which first lines of the first message can be seen. This contains the id, the expeditor and the receivers. WARNING you can't get the full messages body by this way

Get details of an email

From your email object, you just need to do :

await client.getFullEmail(youremail);

It will return you another email which contains all the data from the given one, plus the whole discussion, in a list of Message objects

The message object

You can get from it :

  • The sender
  • The date
  • The message

Homeworks

Get the homeworks

As well as the messaging, this method only return you the first lines of the homework :

var homeworksList = await client.getHomeworks;

It will return you a list of homeworks

Get the full homework

var hw = client.getFullHomework(oldHw);

It will return you the new Hw with the full body

Homework object

You can get from it :

  • The content
  • The type
  • The subject
  • The estimated time (if given by the professor)
  • The status (is realised)
  • The uuid
  • The uuid of the session
  • the Date
Comments
  • Change url handling (proposal)

    Change url handling (proposal)

    I find the name Urls for the enum is not adapted. I think it should be renamed to casUrl.

    Also, the Client would be different:

    class Client {
      final casUrl _url;
      late String token;
      Map<String, String> header = {};
      late UserInfo info;
    
      String get url => _enumToUrl(_url);
    
      Client(this._url, username, password) {
        login(username, password);
      }
    
      ///Create this object if you already have a token
      Client.fromToken(this.token, this._url) {
        header.addAll({'X-Kdecole-Auth': token, 'X-Kdecole-Vers': '3.7.14'});
      }
    ...
    

    What do you think about it @Freezman31?

    enhancement question 
    opened by florian-lefebvre 2
  • Use named parameters

    Use named parameters

    For example at https://github.com/EduWireApps/kdecole-api-dart/blob/ee5d4aac0fd9c11b9874b7260cd4190323480d05/lib/src/entities/email.dart#L10, it would be better to use named parameters like:

    Email({required this._title, required this._body, required this._sender, required this._receivers, required this._id, required this._messages}); 
    

    Also, what is the interest of using private attributes along getters there @Freezman31?

    question 
    opened by florian-lefebvre 2
  • Wrapper update

    Wrapper update

    Hello, This little pull request is to update the dependencies and to make the code more simple to use; by example there is a new field in some entities to know if the object has all it's content loaded from the ENT. I also fixed a bug where if a post on any ENT is any other type than a "actualite" the URL to fetch it's content is different. This is why the wrapper now use the "type" field to know what will be the URL to fetch for the post.

    opened by theskyblockman 1
  • Refactor `invokeApi`

    Refactor `invokeApi`

    I inspected the code of the Client and it looks like the invokeApi uses an url parameter. This parameter is always provided as url + something so this url that is a class attribute could be used directly within invokeApi. Also it should be a private method I think.

    enhancement 
    opened by florian-lefebvre 1
  • Change how library works

    Change how library works

    I didn't know to name this issue xd but basically instead of importing types in each file, use the part and part of keywords. You can have a look there and there.

    enhancement 
    opened by florian-lefebvre 1
Owner
Outils numériques de qualité pour améliorer le quotidien des élèves et étudiants !
null
Unofficial conference app 2020 - The Unofficial Conference App for DroidKaigi 2020 Tokyo.

DroidKaigi 2020 Flutter App ?? The unofficial conference app for DroidKaigi 2020. DroidKaigi 2020 is a conference tailored for developers on 20th and

Kazuki YAMAGUCHI 95 Nov 4, 2022
Unofficial wrapper for using Rapid7 insightOps logs (former LogEntries) with Dart.

An unofficial wrapper for using Rapid7 insightOps logs (former LogEntries) with Dart. This package is using logging package to do the actual logging,

Kirill Bubochkin 2 Mar 3, 2021
A most easily usable RESAS API wrapper in Dart. With this library, you can easily integrate your application with the RESAS API.

A most easily usable RESAS API wrapper library in Dart! 1. About 1.1. What Is RESAS? 1.2. Introduction 1.2.1. Install Library 1.2.2. Import It 1.2.3.

Kato Shinya 2 Apr 7, 2022
Flutter & Dart Unofficial Flat Data API

Flutter & Dart Unofficial Flat Data API Flat Dataset for different helpful Flutter APIs Flutter Releases Currently does a daily snapshot of the Flutte

Leo Farias 21 Dec 26, 2022
A most easily usable Duolingo API wrapper in Dart. Duolingo4D is an open-sourced Dart library.

A most easily usable Duolingo API wrapper in Dart! 1. About Duolingo4D Duolingo4D is an open-sourced Dart library. With Duolingo4D, you can easily int

Kato Shinya 18 Oct 17, 2022
A Dart wrapper of the SMHI Open Data API

SMHI Open Data for Dart This package is in early development and some features may not work as intended. If so, feel free to submit a pull request. A

Lukas 1 Sep 19, 2022
A MangaDex API wrapper for Dart/Flutter

A MangaDex API wrapper for Dart Usage A simple usage example: import 'package:mangadex_api/mangadex_api.dart'; main() { var client = MDClient();

Matyáš Caras 4 Dec 2, 2022
Flutter wrapper widget for Avataaars API

Flutter_avataaar Flutter wrapper widget for Avataaars API - a free online avatar

null 8 Nov 11, 2022
An api wrapper for FortniteApi.io in dart.

Fortnite An api wrapper for FortniteApi.io in dart. Installation Add this to your package's pubspec.yaml file: dependencies: fortnite_api_io: any

Vanxh 3 Jan 29, 2022
DiceBear API wrapper. DiceBear is an avatar library for designers and developers. Generate random avatar profile pictures!

dice_bear Flutter Package DiceBear API wrapper. DiceBear is an avatar library for designers and developers. Generate random avatar profile pictures! C

Zaif Senpai 8 Oct 31, 2022
Dart wrapper for mpesa daraja api by safaricom

mpesa-daraja-plugin-flutter-dart dart wrapper for mpesa daraja api by safaricom Features [Done]Lipa na mpesa [x] [inprogress] C2B [inprogress] B2B [in

Anselmo.Jr 11 Nov 6, 2022
The lightweight and powerful wrapper library for Twitter Ads API written in Dart and Flutter 🐦

TODO: Put a short description of the package here that helps potential users know whether this package might be useful for them. Features TODO: List w

Twitter.dart 2 Aug 26, 2022
The unofficial flutter plugin for Freshchat

?? Flutter Freshchat A Flutter plugin for integrating Freshchat in your mobile app. Setup Android Add this to your AndroidManifest.xml <provider a

Fayeed Pawaskar 31 Jun 2, 2022
unofficial windows client for smotreshka.tv

smotreshka Rebuild models flutter pub run build_runner build --delete-conflicting-outputs Getting Started This project is a starting point for a Flut

null 0 Dec 3, 2021
Unofficial delivery app for Rapidinho made with Flutter

Rapidinho Unofficial delivery app for Rapidinho made with Flutter Getting Started Gradle version: 4.6 Flutter version: 0.8.3 Install Flutter Clone thi

GDG Luanda 190 Dec 26, 2022
Unofficial 🐘 client written in 🎯

mastodon_dart The official Dart library for accessing the Mastodon API. Optionally use in conjunction with mastodon_flutter to build a Flutter Mastodo

Luke Pighetti 21 Dec 22, 2022
Unofficial Turkish Dictionary app of TDK (Turkish Language Association) developing with Flutter

Turkish Dictionary Unofficial Turkish Dictionary app of TDK (Turkish Language Association) developing with Flutter Design Feyza Nur Demirci Şahin Abut

Flutter Turkey 80 Oct 20, 2022
An open-source unofficial GitHub mobile client, that aims to deliver the ultimate GitHub experience on mobile devices.

DioHub for Github Summary Features Roadmap Support Screenshots Build Instructions Summary DioHub is an open-source unofficial GitHub mobile client, th

Naman Shergill 401 Jan 4, 2023
An unofficial Flutter plugin that wraps pusher-websocket-java on Android and pusher-websocket-swift on iOS

Pusher Flutter Client An unofficial Flutter plugin that wraps pusher-websocket-java on Android and pusher-websocket-swift on iOS. Get it from pub. How

HomeX 31 Oct 21, 2022