async_track 0.2.0

  • Installing
  • Versions
  • 8


Build Status Pub

Provides a mechanism for tracking asynchronous events in Dart.

This package is experimental and subject to change. It currently only has knowledge of microtasks and timers, and ignores other forms of asynchronous events DOM access, network events, file I/O.


You can use track asynchronous events once or continuously.


Future/*<E>*/ runTracked/*<E>*/(/*=E*/ action()) runs action within a Zone, and returns a Future when all asynchronous events started by action (or started by other events) complete.

For example, waiting for some tasks to complete:

await runTracked(() {
  // Any of these could use 'scheduleMicrotask' to schedule work.


For continuous tracking, you can use AsyncTracker, which reports progress of asynchronous events continuously. See async_track.dart.

How it works

Uses the Dart Zone API to create an execution context where a function call and all of it's associated calls and asynchronous tasks are associated with that zone.



  • Added AsyncError object
  • Added onError callback to runTracked
  • Added onError stream to AsyncTracker
  • Added useLongStackTraces as a parameter to new AsyncTracker


  • Initial commit

Use this package as a library

1. Depend on it

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

  async_track: "^0.2.0"

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:

      import 'package:async_track/async_track.dart';
Version Uploaded Documentation Archive
0.2.0 Nov 16, 2016 Go to the documentation of async_track 0.2.0 Download async_track 0.2.0 archive
0.1.0 Sep 30, 2016 Go to the documentation of async_track 0.1.0 Download async_track 0.1.0 archive


We analyzed this package on Jun 19, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.63.0
  • pana: 0.11.3


Describes how popular the package is relative to other packages. [more]
0 / 100
Code health derived from static analysis. [more]
0 / 100
Reflects how tidy and up-to-date the package is. [more]
40 / 100
Overall score:
Weighted score of the above. [more]
Learn more about scoring.


Detected platforms: Flutter, web, other

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


  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 5 errors 45 hints.

    Strong-mode analysis of lib/async_track.dart failed with the following error:

    line: 336 col: 48
    The return type 'void' isn't a 'R', as defined by the method 'runGuarded'.

  • Package is getting outdated.

    The package was released 82 weeks ago.

  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use async_track.dart.


Package Constraint Resolved Available
Direct dependencies
meta >=1.0.4 <2.0.0 1.1.5
stack_trace >=1.7.0 <2.0.0 1.9.2
Transitive dependencies
path 1.6.1
Dev dependencies