librus_api 1.0.21

  • Readme
  • Changelog
  • Example
  • Installing
  • 20

A library for Dart developers.

Created from templates made available by Stagehand under a BSD-style license.

Usage #

A simple usage example:

import 'package:librus_api/librus_api.dart';

main() {
  var awesome = new Awesome();
}

Features and bugs #

Please file feature requests and bugs at the issue tracker.

1.0.0 #

  • Initial version, created by Stagehand

example/librus_api_example.dart

import 'dart:convert';
import 'dart:io';

import 'package:librus_api/librus_api.dart';
import 'package:librus_api/librus_api_base.dart';
import 'package:librus_api/models/grade.dart';
import 'package:librus_api/utils/utils.dart';

main() async {
  LibrusApi.init();
  var api = LibrusApi('./cookies');
  await api.signIn(Platform.environment['LIBRUS_USERNAME'],
      Platform.environment['LIBRUS_PASSWORD']);
  print(await api.refresh());
  var accounts = await api.accounts;
  await accounts[0].refresh();
  var data = json.encode(api);
  print(json.decode(data));
  print(json.encode(await fetchSubjects(accounts[0])));
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  librus_api: ^1.0.21

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:librus_api/librus_api.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
52
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
20
Overall:
Weighted score of the above. [more]
20
Learn more about scoring.

We analyzed this package on Oct 16, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, other

Primary library: package:librus_api/librus_api.dart with components: io.

Health issues and suggestions

Fix lib/librus_api_base.dart. (-44.03 points)

Analysis of lib/librus_api_base.dart failed with 2 errors, 1 hint:

line 51 col 41: Too many positional arguments: 0 expected, but 1 found.

line 127 col 41: Too many positional arguments: 0 expected, but 1 found.

line 7 col 8: Unused import: 'package:json_annotation/json_annotation.dart'.

Document public APIs. (-1 points)

187 out of 187 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/account.g.dart. (-1 points)

Analysis of lib/account.g.dart reported 2 hints:

line 9 col 9: The declaration '_$AccountFromJson' isn't referenced.

line 25 col 22: The declaration '_$AccountToJson' isn't referenced.

Fix lib/misc/activator.dart. (-1 points)

Analysis of lib/misc/activator.dart reported 2 hints:

line 34 col 7: Use isEmpty instead of length

line 44 col 7: Use isEmpty instead of length

Fix additional 16 files with analysis or formatting issues. (-4 points)

Additional issues in the following files:

  • lib/utils/utils.dart (2 hints)
  • lib/account.dart (1 hint)
  • lib/models/category.dart (1 hint)
  • lib/models/comment.dart (1 hint)
  • lib/models/grade.dart (1 hint)
  • lib/models/resource.dart (1 hint)
  • lib/models/subject.dart (1 hint)
  • lib/account.reflectable.dart (Run dartfmt to format lib/account.reflectable.dart.)
  • lib/misc/activator.reflectable.dart (Run dartfmt to format lib/misc/activator.reflectable.dart.)
  • lib/models/category.reflectable.dart (Run dartfmt to format lib/models/category.reflectable.dart.)
  • lib/models/comment.reflectable.dart (Run dartfmt to format lib/models/comment.reflectable.dart.)
  • lib/models/grade.reflectable.dart (Run dartfmt to format lib/models/grade.reflectable.dart.)
  • lib/models/resource.reflectable.dart (Run dartfmt to format lib/models/resource.reflectable.dart.)
  • lib/models/serializable.reflectable.dart (Run dartfmt to format lib/models/serializable.reflectable.dart.)
  • lib/models/subject.reflectable.dart (Run dartfmt to format lib/models/subject.reflectable.dart.)
  • lib/utils/utils.reflectable.dart (Run dartfmt to format lib/utils/utils.reflectable.dart.)

Maintenance issues and suggestions

Support latest dependencies. (-40 points)

The version constraint in pubspec.yaml does not support the latest published versions for 4 dependencies (cookie_jar, dio, html, json_serializable).

Homepage URL doesn't exist. (-20 points)

At the time of the analysis the homepage field https://github.com/MatisiekPL/librus-api-dart/ was unreachable.

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
cookie_jar ^0.0.7 0.0.8 1.0.1
dio ^1.0.13 1.0.17 3.0.3
html ^0.13.3+3 0.13.4+2 0.14.0+3
http ^0.12.0 0.12.0+2
json_serializable ^2.0.1 2.3.0 3.2.3
reflectable ^2.0.8 2.1.0
Transitive dependencies
analyzer 0.36.4 0.38.5
args 1.5.2
async 2.4.0
build 1.1.6 1.2.0
build_config 0.4.1+1
build_daemon 2.1.0
build_resolvers 1.2.1
build_runner_core 3.1.1 4.1.0
built_collection 4.2.2
built_value 6.7.1
charcode 1.1.2
checked_yaml 1.0.2
code_builder 3.2.0
collection 1.14.12
convert 2.1.1
crypto 2.1.3
csslib 0.15.0 0.16.1
dart_style 1.2.9 1.3.1
fixnum 0.10.9
front_end 0.1.19 0.1.27
glob 1.2.0
graphs 0.2.0
http_multi_server 2.1.0
http_parser 3.1.3
io 0.3.3
js 0.6.1+1
json_annotation 2.3.0 3.0.0
kernel 0.3.19 0.3.27
logging 0.11.3+2
matcher 0.12.5
meta 1.1.7
mime 0.9.6+3
node_interop 1.0.3
node_io 1.0.1+2
package_config 1.1.0
package_resolver 1.0.10
path 1.6.4
pedantic 1.8.0+1
pool 1.4.0
pub_semver 1.4.2
pubspec_parse 0.1.5
quiver 2.0.5
shelf 0.7.5
shelf_web_socket 0.2.3
source_gen 0.9.4+4 0.9.4+5
source_span 1.5.5
stack_trace 1.9.3
stream_channel 2.0.0
stream_transform 0.0.19
string_scanner 1.0.5
term_glyph 1.1.0
timing 0.1.1+2
typed_data 1.1.6
utf 0.9.0+5
watcher 0.9.7+12
web_socket_channel 1.1.0
yaml 2.2.0
Dev dependencies
build_runner any 1.6.9 1.7.2
test ^1.0.0