cancellation 0.0.0

  • Readme
  • Changelog
  • Example
  • Installing
  • new55

ZXTeam's Cancellation #

pub package build status commit activity badge last commit badge twitter badge

Classes #

CancellationToken #

CancellationTokenSource #

SimpleCancellationTokenSource #

TimeoutCancellationTokenSource #

Usage #

A simple usage example:

import 'package:cancellation/cancellation.dart';

main() {
  final cts = SimpleCancellationTokenSource();

  final CancellationToken token = cts.token;

  // pass token to any cancallable function
}

Features and bugs #

TBD

0.0.0 #

  • Just a stub for initial release.

example/cancellation_example.dart

import 'package:cancellation/cancellation.dart';

main() {
  final cts = SimpleCancellationTokenSource();

  final CancellationToken token = cts.token;

  // pass token to any cancallable function
}

Use this package as a library

1. Depend on it

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


dependencies:
  cancellation: ^0.0.0

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:cancellation/cancellation.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
22
Health:
Code health derived from static analysis. [more]
98
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
72
Overall:
Weighted score of the above. [more]
55
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, web, other

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

Health issues and suggestions

Document public APIs. (-0.03 points)

29 out of 30 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/src/SimpleCancellationTokenSource.dart. (-1 points)

Analysis of lib/src/SimpleCancellationTokenSource.dart reported 2 hints:

line 22 col 9: Use isNotEmpty instead of length

line 33 col 11: Use isNotEmpty instead of length

Fix lib/src/TimeoutCancellationTokenSource.dart. (-0.50 points)

Analysis of lib/src/TimeoutCancellationTokenSource.dart reported 1 hint:

line 25 col 3: Prefer using /// for doc comments.

Maintenance issues and suggestions

Homepage URL isn't helpful. (-10 points)

Update the homepage field from pubspec.yaml: link to a website about the package or use the source repository URL.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

The package description is too short. (-8 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.5.0 <3.0.0
Dev dependencies
build_runner ^1.7.1
build_test ^0.10.8
pedantic ^1.8.0
test ^1.6.0