gitlab 0.4.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 61

GitLab API #

This is a dart library to communicate with the GitLab API v4.

This is still work in progress. We are happy about Merge Requests!

This library is already in production use, but it is missing a lot of calls and properties.

The calls that are present should be safe to use.

There are still tests missing for a lot of resources though.

Installation #

Simply add it to your project as a dependency:

dependencies:
  gitlab: any

Usage #

For the full documentation, and usage, please refer to the documentation.

License #

MIT

0.4.2 #

  • Upgrade dependencies

0.4.1 #

  • Fix type casting issue in issues.closedByMergeRequest()

0.4.0 #

  • Rename the Build class to Job in alignment with the GitLab API.
  • Add tests for .list() requests due to regression bug.

0.3.0 #

  • Make changes for dart 2.0.0 release.

0.2.3 #

  • Broaden the intl dependency to include 0.15.x

0.2.2 #

  • Broaden the SDK restriction to include everything up to 2.0.0.

0.2.1 #

  • Rename merge request get parameter to iid (was id before)

0.2.0 #

  • Switch to API version v4

0.1.3 #

  • Add labels to the merge requests
  • Add tests for merge requests

0.1.2 #

  • Introduce commit.createdAt

0.1.1 #

  • Add proper testing and refactor code base a bit

0.1.0 #

First version.

Introduces basic commands and most of the properties of the most important entities

example/example.dart

import 'package:gitlab/gitlab.dart';

const gitLabToken = 'my-secret-token';
const projectId = 123;

void main() async {
  final project = GitLab(gitLabToken).project(projectId);

  // List all commits that have been done in the last 24h
  final commits = await project.commits
      .list(since: new DateTime.now().subtract(new Duration(days: 1)));

  print(commits.first.message);

  /// The internal id of the merge request.
  final iid = 2;
  final mergeRequest = await project.mergeRequests.get(iid);

  print(mergeRequest.title);
}

Use this package as a library

1. Depend on it

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


dependencies:
  gitlab: ^0.4.2

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

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

  • Dart: 2.6.0
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:gitlab/gitlab.dart.

Health suggestions

Fix lib/gitlab.dart. (-2.96 points)

Analysis of lib/gitlab.dart reported 6 hints, including:

line 53 col 32: Use = to separate a named parameter from its default value.

line 53 col 59: Use = to separate a named parameter from its default value.

line 57 col 17: Use = to separate a named parameter from its default value.

line 57 col 44: Use = to separate a named parameter from its default value.

line 69 col 25: Use = to separate a named parameter from its default value.

Maintenance issues and suggestions

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (intl).

The package description is too short. (-16 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 >=1.21.0 <3.0.0
http ^0.12.0 0.12.0+2
intl ^0.15.6 0.15.8 0.16.0
logging ^0.11.0 0.11.3+2
meta ^1.1.6 1.1.8
Transitive dependencies
async 2.4.0
charcode 1.1.2
collection 1.14.12
http_parser 3.1.3
pedantic 1.8.0+1
source_span 1.5.5
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
Dev dependencies
grind_publish ^0.0.5
grinder ^0.8.1
mockito ^3.0.0
path ^1.6.0 1.6.4
test ^1.5.0