ahgora_api 0.1.8

Ahgora API #

Unofficial Dart API for Ahgora.

About #

This is a Dart (Flutter compatible) project.

Usage #

To use this library, add ahgora_api as a dependency in your pubspec.yaml file.

Example #

import 'package:ahgora_api/ahgora_api.dart';

Ahgora ahgora;

void main() {
  ahgora = Ahgora();
  ahgora.login('COMPANY_ID', 9999, 'USER_PASSWORD')
        .then(_loginCallback);
}

void _loginCallback() {
  if (result) {
    print('Login succeeded!');
    ahgora
      .getMonthlyReport(DateTime.now(), fiscalMonth: false)
      .then(_monthlyReportCallback);
  } else {
    print('Login failed!');
  }
}

void _monthlyReportCallback(MonthlyReport report) {
  print('Employee name: ${report.employee.name}');
  print('First day from this month: ${report.days.first.reference}');
}

Use this package as a library

1. Depend on it

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


dependencies:
  ahgora_api: ^0.1.8

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:ahgora_api/ahgora_api.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
32
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
50
Overall:
Weighted score of the above. [more]
56
Learn more about scoring.

We analyzed this package on Feb 18, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5

Health suggestions

Fix lib/api/ahgora.dart. (-0.50 points)

Analysis of lib/api/ahgora.dart reported 1 hint:

line 39 col 12: The value of the field '_expirationDate' isn't used.

Maintenance issues and suggestions

Provide a file named CHANGELOG.md. (-20 points)

Changelog entries help developers follow the progress of your package. See the example generated by stagehand.

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.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and ahgora_api.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.6.0 <3.0.0
http ^0.12.0+4 0.12.0+4
intl ^0.16.1 0.16.1
json_annotation ^3.0.1 3.0.1
Transitive dependencies
async 2.4.0
charcode 1.1.3
collection 1.14.12
http_parser 3.1.3
meta 1.1.8
path 1.6.4
pedantic 1.9.0
source_span 1.6.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
Dev dependencies
build_runner ^1.7.4
json_serializable ^3.2.5
test any