EduWireApps / kdecole-api-dart

An unofficial wrapper for the kdecole api
MIT License
6 stars 1 forks source link

Change url handling (proposal) #4

Closed florian-lefebvre closed 3 years ago

florian-lefebvre commented 3 years ago

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?

Freezman31 commented 3 years ago

Yes, ynotes (ahahaha)

Freezman31 commented 3 years ago

Done !